Skip to content

Commit 7506825

Browse files
committed
[Issue #66] for LSN mode data_checksums must be enabled
1 parent 496605b commit 7506825

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

src/dir.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1208,8 +1208,9 @@ read_tablespace_map(parray *files, const char *backup_dir)
12081208
* If tablespace-mapping option is supplied, all OLDDIR entries must have
12091209
* entries in tablespace_map file.
12101210
*
1211-
* When running incremental restore with tablespace remapping, then
1212-
* new tablespace directory MUST be empty, because there is no
1211+
*
1212+
* TODO: maybe when running incremental restore with tablespace remapping, then
1213+
* new tablespace directory MUST be empty? because there is no
12131214
* we can be sure, that files laying there belong to our instance.
12141215
*/
12151216
void

src/pg_probackup.h

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ typedef struct RedoParams
105105
{
106106
TimeLineID tli;
107107
XLogRecPtr lsn;
108+
uint32 checksum_version;
108109
} RedoParams;
109110

110111
typedef struct PageState

src/restore.c

+4
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ do_restore_or_validate(time_t target_backup_id, pgRecoveryTarget *rt,
411411
parray *timelines = NULL;
412412
get_redo(instance_config.pgdata, &redo);
413413

414+
if (redo.checksum_version == 0)
415+
elog(ERROR, "Incremental restore in 'lsn' mode require "
416+
"data_checksums to be enabled in destination data directory");
417+
414418
timelines = read_timeline_history(arclog_path, redo.tli, false);
415419

416420
if (!timelines)

src/util.c

+2
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ get_redo(const char *pgdata_path, RedoParams *redo)
380380
redo->lsn = ControlFile.backupStartPoint;
381381
redo->tli = ControlFile.checkPointCopy.ThisTimeLineID;
382382
}
383+
384+
redo->checksum_version = ControlFile.data_checksum_version;
383385
}
384386

385387
/*

0 commit comments

Comments
 (0)