1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-29 22:28:02 +02:00

Bypass database checks when stanza-delete issued with force.

Previously it was not possible to delete a stanza if the PostgreSQL server could not be contacted.

Contributed by Cynthia Shang.
Suggested by Roman.
This commit is contained in:
Cynthia Shang
2019-05-15 13:14:58 -04:00
committed by David Steele
parent 5c1d4bcd0d
commit 18d4cb5741
5 changed files with 70 additions and 12 deletions

View File

@@ -988,6 +988,22 @@ sub run
'succeed on --no-' . cfgOptionName(CFGOPT_ONLINE) . ' with --' . cfgOptionName(CFGOPT_FORCE),
{strOptionalParam => '--no-' . cfgOptionName(CFGOPT_ONLINE) . ' --' . cfgOptionName(CFGOPT_FORCE)});
}
# Stanza-delete --force without access to pgbackrest on database host
#---------------------------------------------------------------------------------------------------------------------------
if ($bTestExtra && !$bS3 && $bHostBackup)
{
# With stanza-delete --force, allow stanza to be deleted regardless of accessiblility of database host
if ($bHostBackup)
{
$oHostDbMaster->stop();
$oHostBackup->stop({strStanza => $self->stanza});
$oHostBackup->stanzaDelete("delete stanza with --force when pgbackrest on pg host not accessible",
{strOptionalParam => ' --' . cfgOptionName(CFGOPT_FORCE)});
$oHostDbMaster->start();
$oHostBackup->start();
}
}
}
}
}