Skip to content

Commit ac4ea5e

Browse files
committed
bugfix: exit with error if validation after backup found corruption
1 parent d27835d commit ac4ea5e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backup.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,10 +996,14 @@ do_backup(time_t start_time, bool no_validate)
996996
if (!no_validate)
997997
pgBackupValidate(&current);
998998

999-
elog(INFO, "Backup %s completed", base36enc(current.start_time));
999+
if (current.status == BACKUP_STATUS_OK ||
1000+
current.status == BACKUP_STATUS_DONE)
1001+
elog(INFO, "Backup %s completed", base36enc(current.start_time));
1002+
else
1003+
elog(ERROR, "Backup %s failed", base36enc(current.start_time));
10001004

10011005
/*
1002-
* After successfil backup completion remove backups
1006+
* After successful backup completion remove backups
10031007
* which are expired according to retention policies
10041008
*/
10051009
if (delete_expired || merge_expired || delete_wal)

0 commit comments

Comments
 (0)