We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent06add7d commit6d8bad7Copy full SHA for 6d8bad7
src/backup.c
@@ -582,6 +582,15 @@ do_backup_instance(void)
582
strlen(" with pg_probackup"));
583
pg_start_backup(label,smooth_checkpoint,¤t);
584
585
+/* For incremental backup check that start_lsn is not from the past */
586
+if (current.backup_mode!=BACKUP_MODE_FULL&&
587
+prev_backup->start_lsn>current.start_lsn)
588
+elog(ERROR,"Current START LSN %X/%X is lower than START LSN %X/%X of previous backup %s. "
589
+"It may indicate that we are trying to backup PostgreSQL instance from the past.",
590
+(uint32) (current.start_lsn >>32), (uint32) (current.start_lsn),
591
+(uint32) (prev_backup->start_lsn >>32), (uint32) (prev_backup->start_lsn),
592
+base36enc(prev_backup->start_time));
593
+
594
/* Update running backup meta with START LSN */
595
write_backup(¤t);
596