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

Fix manifest test in the check command when tablespaces are present.

Fixed by Cynthia Shang.
Reported by Thomas Flatley.
This commit is contained in:
Cynthia Shang
2018-03-19 19:54:03 -04:00
committed by David Steele
parent 8e9e97728c
commit f0a4264f77
7 changed files with 50 additions and 17 deletions

View File

@@ -499,25 +499,11 @@ sub run
executeTest("sudo chown root:root ${strDir}");
executeTest("sudo chmod 400 ${strDir}");
# Determine if there is an invalid pg-host from the config file
my $rhConfig = iniParse(${storageTest()->get($oHostDbStandby->backrestConfig())}, {bRelaxed => true});
my $bBogusHost = false;
for (my $iRemoteIdx = 1; $iRemoteIdx <= cfgOptionIndexTotal(CFGOPT_PG_HOST); $iRemoteIdx++)
{
if (defined($rhConfig->{$self->stanza()}{cfgOptionName(cfgOptionIdFromIndex(CFGOPT_PG_HOST, $iRemoteIdx))}) &&
($rhConfig->{$self->stanza()}{cfgOptionName(cfgOptionIdFromIndex(CFGOPT_PG_HOST, $iRemoteIdx))} eq BOGUS))
{
$bBogusHost = true;
last;
}
}
my $strComment = 'confirm standby manifest->build executed';
# If there is an invalid host, the final error returned from check will be the inability to resolve the name which is
# a read error instead of an open error
if (!$bBogusHost)
if (!$oHostDbStandby->bogusHost())
{
$oHostDbStandby->check($strComment, {iTimeout => 5, iExpectedExitStatus => ERROR_FILE_OPEN});
}
@@ -530,7 +516,7 @@ sub run
executeTest("sudo rmdir ${strDir}");
# Confirm the check command runs without error on a standby (when a bogus host is not configured)
if (!$bBogusHost)
if (!$oHostDbStandby->bogusHost())
{
$oHostDbStandby->check('verify check command on standby');
}
@@ -660,6 +646,12 @@ sub run
my $strIncrBackup = $oHostBackup->backupEnd(CFGOPTVAL_BACKUP_TYPE_INCR, $oExecuteBackup);
# Ensure the check command runs properly with a tablespace unless there is a bogus host
if (!$oHostBackup->bogusHost())
{
$oHostBackup->check( 'check command with tablespace', {iTimeout => 5});
}
# Setup the xid target
#---------------------------------------------------------------------------------------------------------------------------
my $strXidTarget = undef;