Skip to content

Commit 9efea2b

Browse files
committed
Remove get_min_recovery_point() and use get_redo() instead
1 parent eab58c1 commit 9efea2b

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

src/catchup.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,16 @@ do_catchup_instance(const char *source_pgdata, const char *dest_pgdata, PGconn *
186186
(backup_mode == BACKUP_MODE_DIFF_PTRACK ||
187187
backup_mode == BACKUP_MODE_DIFF_DELTA))
188188
{
189+
RedoParams dest_redo;
190+
189191
dest_filelist = parray_new();
190192
dir_list_file(dest_filelist, dest_pgdata,
191193
true, true, false, backup_logs, true, 0, FIO_LOCAL_HOST);
192194

193-
sync_lsn = get_min_recovery_point(dest_pgdata);
195+
// fill dest_redo.lsn and dest_redo.tli
196+
get_redo(dest_pgdata, &dest_redo);
197+
198+
sync_lsn = dest_redo.lsn;
194199
elog(INFO, "syncLSN = %X/%X", (uint32) (sync_lsn >> 32), (uint32) sync_lsn);
195200
}
196201

src/pg_probackup.h

-1
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,6 @@ extern uint32 get_data_checksum_version(bool safe);
11761176
extern pg_crc32c get_pgcontrol_checksum(const char *pgdata_path);
11771177
extern uint32 get_xlog_seg_size(const char *pgdata_path);
11781178
extern void get_redo(const char *pgdata_path, RedoParams *redo);
1179-
extern XLogRecPtr get_min_recovery_point(const char *pgdata_path);
11801179
extern void set_min_recovery_point(pgFile *file, const char *backup_path,
11811180
XLogRecPtr stop_backup_lsn);
11821181
extern void copy_pgcontrol_file(const char *from_fullpath, fio_location from_location,

src/util.c

-15
Original file line numberDiff line numberDiff line change
@@ -384,21 +384,6 @@ get_redo(const char *pgdata_path, RedoParams *redo)
384384
redo->checksum_version = ControlFile.data_checksum_version;
385385
}
386386

387-
/* Get minRecoveryPoint from control file from pgdata_path */
388-
XLogRecPtr
389-
get_min_recovery_point(const char *pgdata_path)
390-
{
391-
ControlFileData ControlFile;
392-
char *buffer;
393-
size_t size;
394-
395-
buffer = slurpFile(pgdata_path, XLOG_CONTROL_FILE, &size, false, FIO_LOCAL_HOST);
396-
digestControlFile(&ControlFile, buffer, size);
397-
pg_free(buffer);
398-
399-
return ControlFile.minRecoveryPoint;
400-
}
401-
402387
/*
403388
* Rewrite minRecoveryPoint of pg_control in backup directory. minRecoveryPoint
404389
* 'as-is' is not to be trusted.

0 commit comments

Comments
 (0)