Skip to content

Commit 30cf458

Browse files
committed
check backup version before backup validation, throw an error if backup version > binary version
1 parent eed5987 commit 30cf458

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/validate.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ pgBackupValidate(pgBackup *backup)
5252
validate_files_arg *threads_args;
5353
int i;
5454

55+
/* Check backup version */
56+
if (backup->program_version &&
57+
parse_program_version(backup->program_version) > parse_program_version(PROGRAM_VERSION))
58+
elog(ERROR, "pg_probackup binary version is %s, but backup %s version is %s. "
59+
"pg_probackup do not guarantee to be forward compatible. "
60+
"Please upgrade pg_probackup binary.",
61+
PROGRAM_VERSION, base36enc(backup->start_time), backup->program_version);
62+
5563
/* Revalidation is attempted for DONE, ORPHAN and CORRUPT backups */
5664
if (backup->status != BACKUP_STATUS_OK &&
5765
backup->status != BACKUP_STATUS_DONE &&

0 commit comments

Comments
 (0)