1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-09-16 09:06:18 +02:00

Up to seven standbys can be configured for backup from standby.`

Contributed by Cynthia Shang.
This commit is contained in:
Cynthia Shang
2017-08-31 19:15:44 -04:00
committed by David Steele
parent 206415d4c7
commit 36e576b483
23 changed files with 969 additions and 84 deletions

View File

@@ -461,6 +461,30 @@ sub run
# Update message for standby
$oHostDbMaster->sqlExecute("update test set message = '$strStandbyMessage'");
if ($oHostDbStandby->pgVersion() >= PG_VERSION_BACKUP_STANDBY)
{
# If there is only a master and a replica and the replica is the backup destination, then if db2-host and db3-host
# are BOGUS, confirm failure to reach the master
if (!$bHostBackup && $bHostStandby && $strBackupDestination eq HOST_DB_STANDBY)
{
my $strStandbyBackup = $oHostBackup->backup(
CFGOPTVAL_BACKUP_TYPE_FULL, 'backup from standby, failure to reach master',
{bStandby => true,
iExpectedExitStatus => ERROR_DB_CONNECT,
strOptionalParam => '--' .
$oHostBackup->optionIndexName(CFGOPT_DB_HOST, cfgOptionIndexTotal(CFGOPT_DB_PATH)) . '=' . BOGUS});
}
else
{
my $strStandbyBackup = $oHostBackup->backup(
CFGOPTVAL_BACKUP_TYPE_FULL, 'backup from standby, failure to access at least one standby',
{bStandby => true,
iExpectedExitStatus => ERROR_HOST_CONNECT,
strOptionalParam => '--' .
$oHostBackup->optionIndexName(CFGOPT_DB_HOST, cfgOptionIndexTotal(CFGOPT_DB_PATH)) . '=' . BOGUS});
}
}
my $strStandbyBackup = $oHostBackup->backup(
CFGOPTVAL_BACKUP_TYPE_FULL, 'backup from standby',
{bStandby => true,