1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Check that clusters are alive and correctly configured during a backup.

Fail the backup if a cluster stops or the standby is promoted. Previously, shutting down the primary would cause an error but it was not detected until the end of the backup. Now the error will happen sooner and a promotion on the standby will also cause an error.
This commit is contained in:
David Steele
2021-12-08 10:16:41 -05:00
committed by GitHub
parent 7b3ea883c7
commit bd2ba802db
6 changed files with 181 additions and 29 deletions

View File

@ -345,6 +345,10 @@ testBackupPqScript(unsigned int pgVersion, time_t backupTimeStart, TestBackupPqS
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 999),
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 1000),
// Ping
HRNPQ_MACRO_IS_STANDBY_QUERY(1, false),
HRNPQ_MACRO_IS_STANDBY_QUERY(1, false),
// Stop backup
HRNPQ_MACRO_STOP_BACKUP_LE_95(1, lsnStopStr, walSegmentStop),
@ -376,6 +380,10 @@ testBackupPqScript(unsigned int pgVersion, time_t backupTimeStart, TestBackupPqS
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 999),
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 1000),
// Ping
HRNPQ_MACRO_IS_STANDBY_QUERY(1, false),
HRNPQ_MACRO_IS_STANDBY_QUERY(1, false),
// Stop backup
HRNPQ_MACRO_STOP_BACKUP_LE_95(1, lsnStopStr, walSegmentStop),
@ -449,6 +457,12 @@ testBackupPqScript(unsigned int pgVersion, time_t backupTimeStart, TestBackupPqS
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 999),
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 1000),
// Ping
HRNPQ_MACRO_IS_STANDBY_QUERY(1, false),
HRNPQ_MACRO_IS_STANDBY_QUERY(2, true),
HRNPQ_MACRO_IS_STANDBY_QUERY(1, false),
HRNPQ_MACRO_IS_STANDBY_QUERY(2, true),
// Stop backup
HRNPQ_MACRO_STOP_BACKUP_96(1, lsnStopStr, walSegmentStop, false),
@ -516,6 +530,10 @@ testBackupPqScript(unsigned int pgVersion, time_t backupTimeStart, TestBackupPqS
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 999),
HRNPQ_MACRO_TIME_QUERY(1, (int64_t)backupTimeStart * 1000 + 1000),
// Ping
HRNPQ_MACRO_IS_STANDBY_QUERY(1, false),
HRNPQ_MACRO_IS_STANDBY_QUERY(1, false),
// Stop backup
HRNPQ_MACRO_STOP_BACKUP_GE_10(1, lsnStopStr, walSegmentStop, true),