Skip to content

Commit 8c9dcbe

Browse files
committed
PGPRO-1918: disable wal validation for RUNNING and ERROR backups
1 parent c4259b8 commit 8c9dcbe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/restore.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,12 @@ do_restore_or_validate(time_t target_backup_id, pgRecoveryTarget *rt,
321321
continue;
322322

323323
pgBackupValidate(tmp_backup);
324-
/* Maybe we should be more paranoid and check for !BACKUP_STATUS_OK? */
325-
if (tmp_backup->status == BACKUP_STATUS_CORRUPT)
324+
/* After pgBackupValidate() only following backup
325+
* states are possible: ERROR, RUNNING, CORRUPT and OK.
326+
* Validate WAL only for OK, because there is no point
327+
* in WAL validation for corrupted, errored or running backups.
328+
*/
329+
if (tmp_backup->status != BACKUP_STATUS_OK)
326330
{
327331
corrupted_backup = tmp_backup;
328332
/* we need corrupted backup index from 'backups' not parent_chain

0 commit comments

Comments
 (0)