1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-29 00:21:56 +02:00

The archive-push command is implemented entirely in C.

This new implementation should behave exactly like the old Perl code with the exception of updated log messages.

Remove as much of the Perl code as possible without breaking other commands.
This commit is contained in:
David Steele
2019-03-29 13:26:33 +00:00
parent 251dbede8f
commit 1b48684713
37 changed files with 1430 additions and 2766 deletions

View File

@ -90,6 +90,7 @@ sub run
$oHostBackup->stanzaCreate('create required data for stanza', {strOptionalParam => '--no-' . cfgOptionName(CFGOPT_ONLINE)});
# Push a WAL segment
&log(INFO, ' push first WAL');
$oHostDbMaster->archivePush($strWalPath, $strWalTestFile, 1);
# Break the database version of the archive info file
@ -97,17 +98,24 @@ sub run
{
$oHostBackup->infoMunge(
$oStorage->pathGet(STORAGE_REPO_ARCHIVE . qw{/} . ARCHIVE_INFO_FILE),
{&INFO_ARCHIVE_SECTION_DB => {&INFO_ARCHIVE_KEY_DB_VERSION => '8.0'}});
{&INFO_ARCHIVE_SECTION_DB => {&INFO_ARCHIVE_KEY_DB_VERSION => '8.0'},
&INFO_ARCHIVE_SECTION_DB_HISTORY => {1 => {&INFO_ARCHIVE_KEY_DB_VERSION => '8.0'}}});
}
# Push two more segments with errors to exceed archive-push-queue-max
$oHostDbMaster->archivePush(
$strWalPath, $strWalTestFile, 2, $iError ? ERROR_FILE_READ : ERROR_ARCHIVE_MISMATCH);
&log(INFO, ' push second WAL');
$oHostDbMaster->archivePush(
$strWalPath, $strWalTestFile, 3, $iError ? ERROR_FILE_READ : ERROR_ARCHIVE_MISMATCH);
$strWalPath, $strWalTestFile, 2, $iError ? ERROR_UNKNOWN : ERROR_ARCHIVE_MISMATCH);
&log(INFO, ' push third WAL');
$oHostDbMaster->archivePush(
$strWalPath, $strWalTestFile, 3, $iError ? ERROR_UNKNOWN : ERROR_ARCHIVE_MISMATCH);
# Now this segment will get dropped
&log(INFO, ' push fourth WAL');
$oHostDbMaster->archivePush($strWalPath, $strWalTestFile, 4, undef, undef, '--repo1-host=bogus');
# Fix the database version