mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-11-28 09:33:54 +02:00
[Issue #66] rename horizonLsn to shift_lsn
This commit is contained in:
parent
62db492105
commit
ff6e11ec82
10
src/data.c
10
src/data.c
@ -848,7 +848,7 @@ backup_non_data_file(pgFile *file, pgFile *prev_file,
|
||||
size_t
|
||||
restore_data_file(parray *parent_chain, pgFile *dest_file, FILE *out,
|
||||
const char *to_fullpath, bool use_bitmap, PageState *checksum_map,
|
||||
XLogRecPtr horizonLsn, datapagemap_t *lsn_map)
|
||||
XLogRecPtr shift_lsn, datapagemap_t *lsn_map)
|
||||
{
|
||||
size_t total_write_len = 0;
|
||||
char *in_buf = pgut_malloc(STDIO_BUFSIZE);
|
||||
@ -934,7 +934,7 @@ restore_data_file(parray *parent_chain, pgFile *dest_file, FILE *out,
|
||||
use_bitmap ? &(dest_file)->pagemap : NULL,
|
||||
checksum_map, backup->checksum_version,
|
||||
/* shiftmap can be used only if backup state precedes the shift */
|
||||
backup->stop_lsn <= horizonLsn ? lsn_map : NULL);
|
||||
backup->stop_lsn <= shift_lsn ? lsn_map : NULL);
|
||||
|
||||
if (fclose(in) != 0)
|
||||
elog(ERROR, "Cannot close file \"%s\": %s", from_fullpath,
|
||||
@ -1893,7 +1893,7 @@ PageState *get_checksum_map(const char *fullpath, uint32 checksum_version,
|
||||
/* return bitmap of valid blocks, bitmap is empty, then NULL is returned */
|
||||
datapagemap_t *
|
||||
get_lsn_map(const char *fullpath, uint32 checksum_version,
|
||||
int n_blocks, XLogRecPtr horizonLsn, BlockNumber segmentno)
|
||||
int n_blocks, XLogRecPtr shift_lsn, BlockNumber segmentno)
|
||||
{
|
||||
FILE *in = NULL;
|
||||
BlockNumber blknum = 0;
|
||||
@ -1907,7 +1907,7 @@ get_lsn_map(const char *fullpath, uint32 checksum_version,
|
||||
elog(ERROR, "Cannot truncate file to blknum %u \"%s\": %s",
|
||||
n_blocks, fullpath, strerror(errno));
|
||||
|
||||
Assert(horizonLsn > 0);
|
||||
Assert(shift_lsn > 0);
|
||||
|
||||
/* open file */
|
||||
in = fopen(fullpath, PG_BINARY_R);
|
||||
@ -1931,7 +1931,7 @@ get_lsn_map(const char *fullpath, uint32 checksum_version,
|
||||
if (read_len == BLCKSZ)
|
||||
{
|
||||
int rc = validate_one_page(read_buffer, segmentno + blknum,
|
||||
horizonLsn, &page_lsn, checksum_version);
|
||||
shift_lsn, &page_lsn, checksum_version);
|
||||
|
||||
if (rc == PAGE_IS_VALID)
|
||||
datapagemap_add(lsn_map, blknum);
|
||||
|
@ -962,7 +962,7 @@ extern void backup_non_data_file_internal(const char *from_fullpath,
|
||||
|
||||
extern size_t restore_data_file(parray *parent_chain, pgFile *dest_file, FILE *out,
|
||||
const char *to_fullpath, bool use_bitmap, PageState *checksum_map,
|
||||
XLogRecPtr horizonLsn, datapagemap_t *lsn_map);
|
||||
XLogRecPtr shift_lsn, datapagemap_t *lsn_map);
|
||||
extern size_t restore_data_file_internal(FILE *in, FILE *out, pgFile *file, uint32 backup_version,
|
||||
const char *from_fullpath, const char *to_fullpath, int nblocks,
|
||||
datapagemap_t *map, PageState *checksum_map, int checksum_version,
|
||||
@ -978,7 +978,7 @@ extern bool create_empty_file(fio_location from_location, const char *to_root,
|
||||
extern PageState *get_checksum_map(const char *fullpath, uint32 checksum_version,
|
||||
int n_blocks, XLogRecPtr dest_stop_lsn, BlockNumber segmentno);
|
||||
extern datapagemap_t *get_lsn_map(const char *fullpath, uint32 checksum_version,
|
||||
int n_blocks, XLogRecPtr horizonLsn, BlockNumber segmentno);
|
||||
int n_blocks, XLogRecPtr shift_lsn, BlockNumber segmentno);
|
||||
extern pid_t check_postmaster(const char *pgdata);
|
||||
|
||||
extern bool check_file_pages(pgFile *file, const char *fullpath, XLogRecPtr stop_lsn,
|
||||
|
@ -76,7 +76,7 @@ typedef struct
|
||||
{
|
||||
BlockNumber n_blocks;
|
||||
BlockNumber segmentno;
|
||||
XLogRecPtr horizonLsn;
|
||||
XLogRecPtr shift_lsn;
|
||||
uint32 checksumVersion;
|
||||
} fio_lsn_map_request;
|
||||
|
||||
@ -2338,7 +2338,7 @@ static void fio_get_checksum_map_impl(int out, char *buf)
|
||||
|
||||
datapagemap_t *
|
||||
fio_get_lsn_map(const char *fullpath, uint32 checksum_version,
|
||||
int n_blocks, XLogRecPtr horizonLsn, BlockNumber segmentno,
|
||||
int n_blocks, XLogRecPtr shift_lsn, BlockNumber segmentno,
|
||||
fio_location location)
|
||||
{
|
||||
datapagemap_t* lsn_map = NULL;
|
||||
@ -2351,7 +2351,7 @@ fio_get_lsn_map(const char *fullpath, uint32 checksum_version,
|
||||
|
||||
req_hdr.n_blocks = n_blocks;
|
||||
req_hdr.segmentno = segmentno;
|
||||
req_hdr.horizonLsn = horizonLsn;
|
||||
req_hdr.shift_lsn = shift_lsn;
|
||||
req_hdr.checksumVersion = checksum_version;
|
||||
|
||||
hdr.cop = FIO_GET_LSN_MAP;
|
||||
@ -2378,7 +2378,7 @@ fio_get_lsn_map(const char *fullpath, uint32 checksum_version,
|
||||
else
|
||||
{
|
||||
lsn_map = get_lsn_map(fullpath, checksum_version, n_blocks,
|
||||
horizonLsn, segmentno);
|
||||
shift_lsn, segmentno);
|
||||
}
|
||||
|
||||
return lsn_map;
|
||||
@ -2392,7 +2392,7 @@ static void fio_get_lsn_map_impl(int out, char *buf)
|
||||
fio_lsn_map_request *req = (fio_lsn_map_request*) buf;
|
||||
|
||||
lsn_map = get_lsn_map(fullpath, req->checksumVersion, req->n_blocks,
|
||||
req->horizonLsn, req->segmentno);
|
||||
req->shift_lsn, req->segmentno);
|
||||
if (lsn_map)
|
||||
hdr.size = lsn_map->bitmapsize;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user