Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6d8bad7

Browse files
committed
bugfix: explicitly forbid incremental backing up instance from the past
1 parent06add7d commit6d8bad7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/backup.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,15 @@ do_backup_instance(void)
582582
strlen(" with pg_probackup"));
583583
pg_start_backup(label,smooth_checkpoint,&current);
584584

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+
585594
/* Update running backup meta with START LSN */
586595
write_backup(&current);
587596

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp