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

Improve archive-push command fault tolerance.

3b8f0ef missed some cases that could cause archive-push to fail:

* Checking archive info.
* Checking to see if a WAL segment already exists.

These cases are now handled so archive-push can succeed on any valid repos.
This commit is contained in:
David Steele
2021-03-25 12:54:49 -04:00
committed by GitHub
parent 2789d3b620
commit 01b8e2258f
16 changed files with 305 additions and 142 deletions

View File

@ -102,12 +102,12 @@ sub run
&log(INFO, ' push second WAL');
$oHostDbPrimary->archivePush(
$strWalPath, $strWalTestFile, 2, $iError ? ERROR_UNKNOWN : ERROR_ARCHIVE_MISMATCH);
$strWalPath, $strWalTestFile, 2, ERROR_REPO_INVALID, undef, $iError ? '--repo1-host=bogus' : undef);
&log(INFO, ' push third WAL');
$oHostDbPrimary->archivePush(
$strWalPath, $strWalTestFile, 3, $iError ? ERROR_UNKNOWN : ERROR_ARCHIVE_MISMATCH);
$strWalPath, $strWalTestFile, 3, ERROR_REPO_INVALID, undef, $iError ? '--repo1-host=bogus' : undef);
# Now this segment will get dropped
&log(INFO, ' push fourth WAL');