mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-04-18 12:33:33 +02:00
bugfix: WAL delivery timeout could cause PostgreSQL instance to be left in in_backup state
This commit is contained in:
parent
6d709fb51c
commit
efc0c8cda3
12
src/backup.c
12
src/backup.c
@ -1076,6 +1076,12 @@ pg_start_backup(const char *label, bool smooth, pgBackup *backup)
|
||||
2,
|
||||
params);
|
||||
|
||||
/*
|
||||
* Set flag that pg_start_backup() was called. If an error will happen it
|
||||
* is necessary to call pg_stop_backup() in backup_cleanup().
|
||||
*/
|
||||
backup_in_progress = true;
|
||||
|
||||
/* Extract timeline and LSN from results of pg_start_backup() */
|
||||
XLogDataFromLSN(PQgetvalue(res, 0, 0), &xlogid, &xrecoff);
|
||||
/* Calculate LSN */
|
||||
@ -1108,12 +1114,6 @@ pg_start_backup(const char *label, bool smooth, pgBackup *backup)
|
||||
/* Wait for start_lsn to be replayed by replica */
|
||||
if (from_replica)
|
||||
wait_replica_wal_lsn(backup->start_lsn, true);
|
||||
|
||||
/*
|
||||
* Set flag that pg_start_backup() was called. If an error will happen it
|
||||
* is necessary to call pg_stop_backup() in backup_cleanup().
|
||||
*/
|
||||
backup_in_progress = true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user