From 8dbbf2de929813d5ed2068c13b8cc5b3c3cfafc2 Mon Sep 17 00:00:00 2001 From: David Steele Date: Tue, 1 May 2018 12:37:06 -0400 Subject: [PATCH] Fix archive-copy throwing "path not found" error for incr/diff backups. Reported by yummyliu, Vitaliy Kukharik. --- doc/xml/release.xml | 19 +++++++++++++++++++ lib/pgBackRest/Backup/Backup.pm | 2 +- test/expect/real-all-001.log | 2 +- test/expect/real-all-002.log | 2 +- test/expect/real-all-003.log | 2 +- test/expect/real-all-004.log | 2 +- test/expect/real-all-005.log | 2 +- test/expect/real-all-006.log | 2 +- .../pgBackRestTest/Module/Real/RealAllTest.pm | 3 +-- 9 files changed, 27 insertions(+), 9 deletions(-) diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 3f0f7b34d..3d8e1326a 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -22,6 +22,15 @@

Fix directory syncs running recursively when only the specified directory should be synced.

+ + + + + + + +

Fix archive-copy throwing path not found error for incr/diff backups.

+
@@ -4544,6 +4553,11 @@ cjames53 + + Vitaliy Kukharik + vitabaks + + Nikhilchandra Kulkarni nikhilchandra-kulkarni @@ -4685,5 +4699,10 @@ David Youatt youattd + + + yummyliu + yummyliu + diff --git a/lib/pgBackRest/Backup/Backup.pm b/lib/pgBackRest/Backup/Backup.pm index 357a6415b..3b2c95634 100644 --- a/lib/pgBackRest/Backup/Backup.pm +++ b/lib/pgBackRest/Backup/Backup.pm @@ -920,7 +920,7 @@ sub process {strCipherPass => $oArchiveInfo->cipherPassSub()}), $oStorageRepo->openWrite(STORAGE_REPO_BACKUP . "/${strBackupLabel}/" . MANIFEST_TARGET_PGDATA . qw{/} . $oBackupManifest->walPath() . "/${strArchive}" . ($bCompress ? qw{.} . COMPRESS_EXT : ''), - {strCipherPass => $strCipherPassBackupSet}) + {bPathCreate => true, strCipherPass => $strCipherPassBackupSet}) ); # Add the archive file to the manifest so it can be part of the restore and checked in validation diff --git a/test/expect/real-all-001.log b/test/expect/real-all-001.log index 8c841a7f7..167de7e0b 100644 --- a/test/expect/real-all-001.log +++ b/test/expect/real-all-001.log @@ -126,7 +126,7 @@ incr backup - fail on archive_mode=always (db-master host) ------------------------------------------------------------------------------------------------------------------------------------ incr backup - update during backup (db-master host) -> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stop-auto --no-archive-check --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y +> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stop-auto --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y ------------------------------------------------------------------------------------------------------------------------------------ + supplemental file: [TEST_PATH]/db-master/pgbackrest.conf diff --git a/test/expect/real-all-002.log b/test/expect/real-all-002.log index 6dc0d6625..f79e369e3 100644 --- a/test/expect/real-all-002.log +++ b/test/expect/real-all-002.log @@ -153,7 +153,7 @@ check db - verify check command on standby (db-standby host) ------------------------------------------------------------------------------------------------------------------------------------ incr backup - update during backup (db-master host) -> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stop-auto --no-archive-check --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y +> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stop-auto --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y ------------------------------------------------------------------------------------------------------------------------------------ + supplemental file: [TEST_PATH]/db-master/pgbackrest.conf diff --git a/test/expect/real-all-003.log b/test/expect/real-all-003.log index f7e730f54..fde76ffe0 100644 --- a/test/expect/real-all-003.log +++ b/test/expect/real-all-003.log @@ -153,7 +153,7 @@ check db - confirm standby manifest->build executed (db-standby host) ------------------------------------------------------------------------------------------------------------------------------------ incr backup - update during backup (db-standby host) -> [CONTAINER-EXEC] db-standby [BACKREST-BIN] --config=[TEST_PATH]/db-standby/pgbackrest.conf --stop-auto --no-archive-check --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y +> [CONTAINER-EXEC] db-standby [BACKREST-BIN] --config=[TEST_PATH]/db-standby/pgbackrest.conf --stop-auto --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y ------------------------------------------------------------------------------------------------------------------------------------ + supplemental file: [TEST_PATH]/db-master/pgbackrest.conf diff --git a/test/expect/real-all-004.log b/test/expect/real-all-004.log index 2a9066e9c..719fc397f 100644 --- a/test/expect/real-all-004.log +++ b/test/expect/real-all-004.log @@ -165,7 +165,7 @@ start all stanzas (db-master host) ------------------------------------------------------------------------------------------------------------------------------------ incr backup - update during backup (backup host) -> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stop-auto --no-archive-check --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y +> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stop-auto --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y ------------------------------------------------------------------------------------------------------------------------------------ + supplemental file: [TEST_PATH]/db-master/pgbackrest.conf diff --git a/test/expect/real-all-005.log b/test/expect/real-all-005.log index d56e8246b..0513f40c9 100644 --- a/test/expect/real-all-005.log +++ b/test/expect/real-all-005.log @@ -211,7 +211,7 @@ check db - verify check command on standby (db-standby host) ------------------------------------------------------------------------------------------------------------------------------------ incr backup - update during backup (backup host) -> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stop-auto --no-archive-check --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y +> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stop-auto --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y ------------------------------------------------------------------------------------------------------------------------------------ + supplemental file: [TEST_PATH]/db-master/pgbackrest.conf diff --git a/test/expect/real-all-006.log b/test/expect/real-all-006.log index 7b4420f77..8d905ea10 100644 --- a/test/expect/real-all-006.log +++ b/test/expect/real-all-006.log @@ -164,7 +164,7 @@ archive-copy=y start-fast=y incr backup - update during backup (backup host) -> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stop-auto --no-archive-check --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y +> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stop-auto --buffer-size=32768 --stanza=db backup --test --test-delay=1 --test-point=manifest-build=y ------------------------------------------------------------------------------------------------------------------------------------ + supplemental file: [TEST_PATH]/db-master/pgbackrest.conf diff --git a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm index 3aee8e99b..341d24169 100644 --- a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm +++ b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm @@ -621,8 +621,7 @@ sub run $oExecuteBackup = $oHostBackup->backupBegin( CFGOPTVAL_BACKUP_TYPE_INCR, 'update during backup', {strTest => TEST_MANIFEST_BUILD, fTestDelay => $fTestDelay, - strOptionalParam => '--' . cfgOptionName(CFGOPT_STOP_AUTO) . ' --no-' . cfgOptionName(CFGOPT_ARCHIVE_CHECK) . - ' --' . cfgOptionName(CFGOPT_BUFFER_SIZE) . '=32768'}); + strOptionalParam => '--' . cfgOptionName(CFGOPT_STOP_AUTO) . ' --' . cfgOptionName(CFGOPT_BUFFER_SIZE) . '=32768'}); # Drop a table $oHostDbMaster->sqlExecute('drop table test_remove');