Skip to content

Commit ff6e11e

Browse files
committed
[Issue #66] rename horizonLsn to shift_lsn
1 parent 62db492 commit ff6e11e

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/data.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ backup_non_data_file(pgFile *file, pgFile *prev_file,
848848
size_t
849849
restore_data_file(parray *parent_chain, pgFile *dest_file, FILE *out,
850850
const char *to_fullpath, bool use_bitmap, PageState *checksum_map,
851-
XLogRecPtr horizonLsn, datapagemap_t *lsn_map)
851+
XLogRecPtr shift_lsn, datapagemap_t *lsn_map)
852852
{
853853
size_t total_write_len = 0;
854854
char *in_buf = pgut_malloc(STDIO_BUFSIZE);
@@ -934,7 +934,7 @@ restore_data_file(parray *parent_chain, pgFile *dest_file, FILE *out,
934934
use_bitmap ? &(dest_file)->pagemap : NULL,
935935
checksum_map, backup->checksum_version,
936936
/* shiftmap can be used only if backup state precedes the shift */
937-
backup->stop_lsn <= horizonLsn ? lsn_map : NULL);
937+
backup->stop_lsn <= shift_lsn ? lsn_map : NULL);
938938

939939
if (fclose(in) != 0)
940940
elog(ERROR, "Cannot close file \"%s\": %s", from_fullpath,
@@ -1893,7 +1893,7 @@ PageState *get_checksum_map(const char *fullpath, uint32 checksum_version,
18931893
/* return bitmap of valid blocks, bitmap is empty, then NULL is returned */
18941894
datapagemap_t *
18951895
get_lsn_map(const char *fullpath, uint32 checksum_version,
1896-
int n_blocks, XLogRecPtr horizonLsn, BlockNumber segmentno)
1896+
int n_blocks, XLogRecPtr shift_lsn, BlockNumber segmentno)
18971897
{
18981898
FILE *in = NULL;
18991899
BlockNumber blknum = 0;
@@ -1907,7 +1907,7 @@ get_lsn_map(const char *fullpath, uint32 checksum_version,
19071907
elog(ERROR, "Cannot truncate file to blknum %u \"%s\": %s",
19081908
n_blocks, fullpath, strerror(errno));
19091909

1910-
Assert(horizonLsn > 0);
1910+
Assert(shift_lsn > 0);
19111911

19121912
/* open file */
19131913
in = fopen(fullpath, PG_BINARY_R);
@@ -1931,7 +1931,7 @@ get_lsn_map(const char *fullpath, uint32 checksum_version,
19311931
if (read_len == BLCKSZ)
19321932
{
19331933
int rc = validate_one_page(read_buffer, segmentno + blknum,
1934-
horizonLsn, &page_lsn, checksum_version);
1934+
shift_lsn, &page_lsn, checksum_version);
19351935

19361936
if (rc == PAGE_IS_VALID)
19371937
datapagemap_add(lsn_map, blknum);

src/pg_probackup.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ extern void backup_non_data_file_internal(const char *from_fullpath,
962962

963963
extern size_t restore_data_file(parray *parent_chain, pgFile *dest_file, FILE *out,
964964
const char *to_fullpath, bool use_bitmap, PageState *checksum_map,
965-
XLogRecPtr horizonLsn, datapagemap_t *lsn_map);
965+
XLogRecPtr shift_lsn, datapagemap_t *lsn_map);
966966
extern size_t restore_data_file_internal(FILE *in, FILE *out, pgFile *file, uint32 backup_version,
967967
const char *from_fullpath, const char *to_fullpath, int nblocks,
968968
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,
978978
extern PageState *get_checksum_map(const char *fullpath, uint32 checksum_version,
979979
int n_blocks, XLogRecPtr dest_stop_lsn, BlockNumber segmentno);
980980
extern datapagemap_t *get_lsn_map(const char *fullpath, uint32 checksum_version,
981-
int n_blocks, XLogRecPtr horizonLsn, BlockNumber segmentno);
981+
int n_blocks, XLogRecPtr shift_lsn, BlockNumber segmentno);
982982
extern pid_t check_postmaster(const char *pgdata);
983983

984984
extern bool check_file_pages(pgFile *file, const char *fullpath, XLogRecPtr stop_lsn,

src/utils/file.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ typedef struct
7676
{
7777
BlockNumber n_blocks;
7878
BlockNumber segmentno;
79-
XLogRecPtr horizonLsn;
79+
XLogRecPtr shift_lsn;
8080
uint32 checksumVersion;
8181
} fio_lsn_map_request;
8282

@@ -2338,7 +2338,7 @@ static void fio_get_checksum_map_impl(int out, char *buf)
23382338

23392339
datapagemap_t *
23402340
fio_get_lsn_map(const char *fullpath, uint32 checksum_version,
2341-
int n_blocks, XLogRecPtr horizonLsn, BlockNumber segmentno,
2341+
int n_blocks, XLogRecPtr shift_lsn, BlockNumber segmentno,
23422342
fio_location location)
23432343
{
23442344
datapagemap_t* lsn_map = NULL;
@@ -2351,7 +2351,7 @@ fio_get_lsn_map(const char *fullpath, uint32 checksum_version,
23512351

23522352
req_hdr.n_blocks = n_blocks;
23532353
req_hdr.segmentno = segmentno;
2354-
req_hdr.horizonLsn = horizonLsn;
2354+
req_hdr.shift_lsn = shift_lsn;
23552355
req_hdr.checksumVersion = checksum_version;
23562356

23572357
hdr.cop = FIO_GET_LSN_MAP;
@@ -2378,7 +2378,7 @@ fio_get_lsn_map(const char *fullpath, uint32 checksum_version,
23782378
else
23792379
{
23802380
lsn_map = get_lsn_map(fullpath, checksum_version, n_blocks,
2381-
horizonLsn, segmentno);
2381+
shift_lsn, segmentno);
23822382
}
23832383

23842384
return lsn_map;
@@ -2392,7 +2392,7 @@ static void fio_get_lsn_map_impl(int out, char *buf)
23922392
fio_lsn_map_request *req = (fio_lsn_map_request*) buf;
23932393

23942394
lsn_map = get_lsn_map(fullpath, req->checksumVersion, req->n_blocks,
2395-
req->horizonLsn, req->segmentno);
2395+
req->shift_lsn, req->segmentno);
23962396
if (lsn_map)
23972397
hdr.size = lsn_map->bitmapsize;
23982398
else

0 commit comments

Comments
 (0)