diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b40b9018..2c2ad1870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ __No Release Date Set__ * Generate an error when `archive-check=y` but `archive_command` does not execute `pg_backrest`. _Contributed by Jason O'Donnell_. +* Added checks for `--delta` and `--force` restore options to ensure that the destination is a valid $PGDATA directory. pgBackRest will check for the presence of `PG_VERSION` or `backup.manifest` (left over from an aborted restore). If neither is found then `--delta` and `--force` will be disabled but the restore will proceed unless there are files in the $PGDATA directory (or any tablespace directories) in which case the operation will be aborted. + * When restore `--set=latest` (the default) the actual backup restored will be output to the log. * Support for PostgreSQL 9.5 partial WAL segments and `recovery_target_action` setting. The `archive_mode = 'always'` setting is not yet supported. diff --git a/doc/xml/change-log.xml b/doc/xml/change-log.xml index 3cf085765..e39f9d348 100644 --- a/doc/xml/change-log.xml +++ b/doc/xml/change-log.xml @@ -26,6 +26,9 @@ Generate an error when archive-check=y but archive_command does not execute pg_backrest. Contributed by Jason O'Donnell. + + Added checks for --delta and --force restore options to ensure that the destination is a valid $PGDATA directory. will check for the presence of PG_VERSION or backup.manifest (left over from an aborted restore). If neither is found then --delta and --force will be disabled but the restore will proceed unless there are files in the $PGDATA directory (or any tablespace directories) in which case the operation will be aborted. + When restore --set=latest (the default) the actual backup restored will be output to the log. diff --git a/lib/BackRest/Config/Config.pm b/lib/BackRest/Config/Config.pm index 10d6e7aeb..acd1c7153 100644 --- a/lib/BackRest/Config/Config.pm +++ b/lib/BackRest/Config/Config.pm @@ -2137,6 +2137,26 @@ sub optionGet push @EXPORT, qw(optionGet); +#################################################################################################################################### +# optionSet +# +# Set option value. +#################################################################################################################################### +sub optionSet +{ + my $strOption = shift; + my $oValue = shift; + + if (!defined($oOption{$strOption}{value})) + { + confess &log(ASSERT, "option ${strOption} is not defined"); + } + + $oOption{$strOption}{value} = $oValue; +} + +push @EXPORT, qw(optionSet); + #################################################################################################################################### # optionTest # diff --git a/lib/BackRest/Db.pm b/lib/BackRest/Db.pm index c9a14375e..0f51de082 100644 --- a/lib/BackRest/Db.pm +++ b/lib/BackRest/Db.pm @@ -42,11 +42,14 @@ use constant OP_DB_VERSION_GET => OP_DB . " use constant OP_DB_VERSION_SUPPORT => OP_DB . "->versionSupport"; #################################################################################################################################### -# Postmaster process Id file +# Postgres filename constants #################################################################################################################################### use constant FILE_POSTMASTER_PID => 'postmaster.pid'; push @EXPORT, qw(FILE_POSTMASTER_PID); +use constant FILE_PG_VERSION => 'PG_VERSION'; + push @EXPORT, qw(FILE_PG_VERSION); + #################################################################################################################################### # Backup advisory lock #################################################################################################################################### diff --git a/lib/BackRest/Restore.pm b/lib/BackRest/Restore.pm index a00cef7ff..3981f922a 100644 --- a/lib/BackRest/Restore.pm +++ b/lib/BackRest/Restore.pm @@ -239,9 +239,6 @@ sub manifestLoad my $oManifest = new BackRest::Manifest($self->{oFile}->pathGet(PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_MANIFEST)); - # Remove the manifest now that it is in memory - $self->{oFile}->remove(PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_MANIFEST); - # Log the backup set to restore &log(INFO, "restore backup set " . $oManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_LABEL)); @@ -359,10 +356,10 @@ sub clean foreach my $strPathKey ($oManifest->keys(MANIFEST_SECTION_BACKUP_PATH)) { my $strPath = $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_PATH); + my $bTablespace = $oManifest->test(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK); # Update path if this is a tablespace - if ($oManifest->numericGet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION) >= 9.0 && - $oManifest->test(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK)) + if ($bTablespace && $oManifest->numericGet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION) >= 9.0) { $strPath .= '/' . $oManifest->tablespacePathGet(); } @@ -381,7 +378,7 @@ sub clean foreach my $strName (sort {$b cmp $a} (keys(%{$oPathManifest{name}}))) { # Skip the root path - if ($strName eq '.') + if ($strName eq '.' || (!$bTablespace && $strName eq FILE_MANIFEST)) { next; } @@ -742,6 +739,20 @@ sub process confess &log(ERROR, 'unable to restore while Postgres is running', ERROR_POSTMASTER_RUNNING); } + # If the restore will be destructive attempt to verify that $PGDATA is valid + if ((optionGet(OPTION_DELTA) || optionGet(OPTION_FORCE)) && + !($self->{oFile}->exists(PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_PG_VERSION) || + $self->{oFile}->exists(PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_MANIFEST))) + { + &log(WARN, '--delta or --force specified but unable to find \'' . FILE_PG_VERSION . '\' or \'' . FILE_MANIFEST . + '\' in \'' . $self->{strDbClusterPath} . '\' to confirm that this is a valid $PGDATA directory.' . + ' --delta and --force have been disabled and if any files exist in the destination directories the restore' . + ' will be aborted.'); + + optionSet(OPTION_DELTA, false); + optionSet(OPTION_FORCE, false); + } + # Make sure the backup path is valid and load the manifest my $oManifest = $self->manifestLoad(); @@ -924,6 +935,9 @@ sub process optionGet(OPTION_FORCE), $self->{strBackupSet}, $bSourceCompression, $strCurrentUser, $strCurrentGroup, $self->{oFile}, $lSizeTotal, $lSizeCurrent); + # Finally remove the manifest to indicate the restore is complete + $self->{oFile}->remove(PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_MANIFEST, undef, false); + # Return from function and log return values if any return logDebugReturn($strOperation); } diff --git a/test/lib/BackRestTest/BackupTest.pm b/test/lib/BackRestTest/BackupTest.pm index 414cf5604..735d55412 100755 --- a/test/lib/BackRestTest/BackupTest.pm +++ b/test/lib/BackRestTest/BackupTest.pm @@ -1060,15 +1060,36 @@ sub BackRestTestBackup_Test BackRestTestBackup_FileRemove(\%oManifest, 'base', 'link-test'); BackRestTestBackup_LinkCreate(\%oManifest, 'base', 'link-test', '/wrong'); - # Remove an path + # Remove a path BackRestTestBackup_PathRemove(\%oManifest, 'base', 'path-test'); # Remove a file - BackRestTestBackup_FileRemove(\%oManifest, 'base', 'PG_VERSION'); + BackRestTestBackup_FileRemove(\%oManifest, 'base', 'base/base1.txt'); BackRestTestBackup_Restore($oFile, $strFullBackup, $strStanza, $bRemote, \%oManifest, undef, $bDelta, $bForce, undef, undef, undef, undef, undef, undef, 'add and delete files'); + # Restore - test errors when $PGDATA cannot be verified + #----------------------------------------------------------------------------------------------------------------------- + $bDelta = true; + $bForce = true; + + # Remove PG_VERSION + BackRestTestBackup_FileRemove(\%oManifest, 'base', 'PG_VERSION'); + + # Attempt the restore + BackRestTestBackup_Restore($oFile, $strFullBackup, $strStanza, $bRemote, \%oManifest, undef, $bDelta, $bForce, + undef, undef, undef, undef, undef, undef, + 'fail on missing PG_VERSION', ERROR_RESTORE_PATH_NOT_EMPTY, '--log-level-console=info'); + + # Write a backup.manifest file to make $PGDATA valid + BackRestTestCommon_FileCreate(BackRestTestCommon_DbCommonPathGet() . '/backup.manifest', 'BOGUS'); + + # Restore succeeds + BackRestTestBackup_Restore($oFile, $strFullBackup, $strStanza, $bRemote, \%oManifest, undef, $bDelta, $bForce, + undef, undef, undef, undef, undef, undef, + 'restore succeeds with backup.manifest file', undef, '--log-level-console=info'); + # Various broken info tests #----------------------------------------------------------------------------------------------------------------------- $strType = 'incr'; @@ -1218,6 +1239,7 @@ sub BackRestTestBackup_Test # Restore #----------------------------------------------------------------------------------------------------------------------- $bDelta = false; + $bForce = false; # Fail on used path BackRestTestBackup_Restore($oFile, $strBackup, $strStanza, $bRemote, \%oManifest, undef, $bDelta, $bForce, diff --git a/test/lib/BackRestTest/Common/LogTest.pm b/test/lib/BackRestTest/Common/LogTest.pm index 48e160fbf..58509a77f 100644 --- a/test/lib/BackRestTest/Common/LogTest.pm +++ b/test/lib/BackRestTest/Common/LogTest.pm @@ -340,6 +340,7 @@ sub regExpReplaceAll $strLine = $self->regExpReplace($strLine, 'PROCESS-ID', 'process [0-9]+', '[0-9]+$', false); $strLine = $self->regExpReplace($strLine, 'MODIFICATION-TIME', 'lModificationTime = [0-9]+', '[0-9]+$'); + $strLine = $self->regExpReplace($strLine, 'MODIFICATION-TIME', 'and modification time [0-9]+', '[0-9]+$'); $strLine = $self->regExpReplace($strLine, 'TIMESTAMP', 'timestamp"[ ]{0,1}:[ ]{0,1}[0-9]+','[0-9]+$'); $strLine = $self->regExpReplace($strLine, 'BACKUP-INCR', '[0-9]{8}\-[0-9]{6}F\_[0-9]{8}\-[0-9]{6}I'); diff --git a/test/log/backup-synthetic-001.log b/test/log/backup-synthetic-001.log index ea71dbe24..779b2ad1f 100644 --- a/test/log/backup-synthetic-001.log +++ b/test/log/backup-synthetic-001.log @@ -540,12 +540,12 @@ DEBUG: Common:::Lock::lockAquire=>: bResult = true DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = [BACKUP-FULL-2], strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-FULL-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-FULL-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -579,16 +579,16 @@ DEBUG: File->exists(): strPath = [TEST_PATH]/db/common, strPathType = db:abs DEBUG: File->exists=>: bExists = true DEBUG: Restore->process: restore in main process DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/base/base1.txt, strPathType = db:absolute -DEBUG: File->exists=>: bExists = true -DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/base/base1.txt, strHashType = , strPathType = db:absolute -DEBUG: File->hashSize=>: iSize = 4, strHash = a3b357a3e395e43fcfb19bb13f3c1b5179279593 - INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches backup (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 -DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute DEBUG: File->exists=>: bExists = false -DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/PG_VERSION, strSourcePathType = backup:cluster, strUser = [USER-1] -DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] -DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strSourcePathType = absolute - INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 +DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/base/base1.txt, strSourcePathType = backup:cluster, strUser = [USER-1] +DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] +DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strSourcePathType = absolute + INFO: restore file [TEST_PATH]/db/common/base/base1.txt (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true +DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/PG_VERSION, strHashType = , strPathType = db:absolute +DEBUG: File->hashSize=>: iSize = 3, strHash = e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION - exists and matches backup (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/recovery.conf, strPathType = db:absolute DEBUG: File->exists=>: bExists = false INFO: wrote [TEST_PATH]/db/common/recovery.conf @@ -599,6 +599,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -607,6 +609,34 @@ DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false -------------------------------------------------------- restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get %f "%p"' +restore delta, force, backup '[BACKUP-FULL-2]', expect exit 115 (fail on missing PG_VERSION) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --no-compress --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + WARN: --delta or --force specified but unable to find 'PG_VERSION' or 'backup.manifest' in '[TEST_PATH]/db/common' to confirm that this is a valid $PGDATA directory. --delta and --force have been disabled and if any files exist in the destination directories the restore will be aborted. + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common +ERROR: [115]: cannot restore to path '[TEST_PATH]/db/common' that contains files - try using --delta if this is what you intended + INFO: restore stop + +restore delta, force, backup '[BACKUP-FULL-2]' (restore succeeds with backup.manifest file) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --no-compress --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common + INFO: cleanup removed 1 file + INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches size 4 and modification time [MODIFICATION-TIME-2] (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: wrote [TEST_PATH]/db/common/recovery.conf + INFO: restore global/pg_control (copied last to ensure aborted restores cannot be started) + INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 + INFO: restore stop + ++ supplemental file: [TEST_PATH]/db/common/recovery.conf +-------------------------------------------------------- +restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --log-level-console=info --stanza=db archive-get %f "%p"' + incr backup (invalid database version) > [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-start-stop --stanza=db backup ------------------------------------------------------------------------------------------------------------------------------------ @@ -1570,8 +1600,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -1641,8 +1669,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] INFO: remap base path to [TEST_PATH]/db/common-2 INFO: remap tablespace 1 to [TEST_PATH]/db/tablespace/ts1-2 @@ -1736,6 +1762,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -3234,12 +3262,12 @@ DEBUG: Common:::Lock::lockAquire=>: bResult = true DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = latest, strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = latest/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-5] INFO: remap tablespace 2 to [TEST_PATH]/db/common-2/pg_tblspc/2 DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/global/pg_control, strPathType = db:absolute @@ -3323,6 +3351,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false diff --git a/test/log/backup-synthetic-002.log b/test/log/backup-synthetic-002.log index f579c9aed..cfaab0bae 100644 --- a/test/log/backup-synthetic-002.log +++ b/test/log/backup-synthetic-002.log @@ -431,12 +431,12 @@ DEBUG: Common:::Lock::lockAquire=>: bResult = true DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = [BACKUP-FULL-2], strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-FULL-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-FULL-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -470,16 +470,16 @@ DEBUG: File->exists(): strPath = [TEST_PATH]/db/common, strPathType = db:abs DEBUG: File->exists=>: bExists = true DEBUG: Restore->process: restore in main process DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/base/base1.txt, strPathType = db:absolute -DEBUG: File->exists=>: bExists = true -DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/base/base1.txt, strHashType = , strPathType = db:absolute -DEBUG: File->hashSize=>: iSize = 4, strHash = a3b357a3e395e43fcfb19bb13f3c1b5179279593 - INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches backup (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 -DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute DEBUG: File->exists=>: bExists = false -DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/PG_VERSION, strSourcePathType = backup:cluster, strUser = [USER-1] -DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] -DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strSourcePathType = absolute - INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 +DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/base/base1.txt, strSourcePathType = backup:cluster, strUser = [USER-1] +DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] +DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strSourcePathType = absolute + INFO: restore file [TEST_PATH]/db/common/base/base1.txt (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true +DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/PG_VERSION, strHashType = , strPathType = db:absolute +DEBUG: File->hashSize=>: iSize = 3, strHash = e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION - exists and matches backup (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/recovery.conf, strPathType = db:absolute DEBUG: File->exists=>: bExists = false INFO: wrote [TEST_PATH]/db/common/recovery.conf @@ -490,6 +490,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -498,6 +500,34 @@ DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false -------------------------------------------------------- restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get %f "%p"' +restore delta, force, backup '[BACKUP-FULL-2]', expect exit 115 (fail on missing PG_VERSION) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --no-compress --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + WARN: --delta or --force specified but unable to find 'PG_VERSION' or 'backup.manifest' in '[TEST_PATH]/db/common' to confirm that this is a valid $PGDATA directory. --delta and --force have been disabled and if any files exist in the destination directories the restore will be aborted. + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common +ERROR: [115]: cannot restore to path '[TEST_PATH]/db/common' that contains files - try using --delta if this is what you intended + INFO: restore stop + +restore delta, force, backup '[BACKUP-FULL-2]' (restore succeeds with backup.manifest file) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --no-compress --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common + INFO: cleanup removed 1 file + INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches size 4 and modification time [MODIFICATION-TIME-2] (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: wrote [TEST_PATH]/db/common/recovery.conf + INFO: restore global/pg_control (copied last to ensure aborted restores cannot be started) + INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 + INFO: restore stop + ++ supplemental file: [TEST_PATH]/db/common/recovery.conf +-------------------------------------------------------- +restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --log-level-console=info --stanza=db archive-get %f "%p"' + incr backup (invalid database version) > [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-start-stop --stanza=db backup ------------------------------------------------------------------------------------------------------------------------------------ @@ -1516,8 +1546,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -1587,8 +1615,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] INFO: remap base path to [TEST_PATH]/db/common-2 INFO: remap tablespace 1 to [TEST_PATH]/db/tablespace/ts1-2 @@ -1682,6 +1708,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -3258,12 +3286,12 @@ DEBUG: Common:::Lock::lockAquire=>: bResult = true DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = latest, strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = latest/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-5] INFO: remap tablespace 2 to [TEST_PATH]/db/common-2/pg_tblspc/2 DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/global/pg_control, strPathType = db:absolute @@ -3347,6 +3375,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false diff --git a/test/log/backup-synthetic-003.log b/test/log/backup-synthetic-003.log index d28bc1a36..69585db3e 100644 --- a/test/log/backup-synthetic-003.log +++ b/test/log/backup-synthetic-003.log @@ -427,12 +427,12 @@ DEBUG: Common:::Lock::lockAquire=>: bResult = true DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = [BACKUP-FULL-2], strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-FULL-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-FULL-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -466,16 +466,16 @@ DEBUG: File->exists(): strPath = [TEST_PATH]/db/common, strPathType = db:abs DEBUG: File->exists=>: bExists = true DEBUG: Restore->process: restore in main process DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/base/base1.txt, strPathType = db:absolute -DEBUG: File->exists=>: bExists = true -DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/base/base1.txt, strHashType = , strPathType = db:absolute -DEBUG: File->hashSize=>: iSize = 4, strHash = a3b357a3e395e43fcfb19bb13f3c1b5179279593 - INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches backup (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 -DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute DEBUG: File->exists=>: bExists = false -DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/PG_VERSION.gz, strSourcePathType = backup:cluster, strUser = [USER-1] -DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] -DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strSourcePathType = absolute - INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 +DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/base/base1.txt.gz, strSourcePathType = backup:cluster, strUser = [USER-1] +DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] +DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strSourcePathType = absolute + INFO: restore file [TEST_PATH]/db/common/base/base1.txt (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true +DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/PG_VERSION, strHashType = , strPathType = db:absolute +DEBUG: File->hashSize=>: iSize = 3, strHash = e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION - exists and matches backup (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/recovery.conf, strPathType = db:absolute DEBUG: File->exists=>: bExists = false INFO: wrote [TEST_PATH]/db/common/recovery.conf @@ -486,6 +486,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -494,6 +496,34 @@ DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false -------------------------------------------------------- restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get %f "%p"' +restore delta, force, backup '[BACKUP-FULL-2]', expect exit 115 (fail on missing PG_VERSION) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + WARN: --delta or --force specified but unable to find 'PG_VERSION' or 'backup.manifest' in '[TEST_PATH]/db/common' to confirm that this is a valid $PGDATA directory. --delta and --force have been disabled and if any files exist in the destination directories the restore will be aborted. + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common +ERROR: [115]: cannot restore to path '[TEST_PATH]/db/common' that contains files - try using --delta if this is what you intended + INFO: restore stop + +restore delta, force, backup '[BACKUP-FULL-2]' (restore succeeds with backup.manifest file) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common + INFO: cleanup removed 1 file + INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches size 4 and modification time [MODIFICATION-TIME-2] (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: wrote [TEST_PATH]/db/common/recovery.conf + INFO: restore global/pg_control (copied last to ensure aborted restores cannot be started) + INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 + INFO: restore stop + ++ supplemental file: [TEST_PATH]/db/common/recovery.conf +-------------------------------------------------------- +restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --log-level-console=info --stanza=db archive-get %f "%p"' + incr backup (invalid database version) > [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-start-stop --stanza=db backup ------------------------------------------------------------------------------------------------------------------------------------ @@ -1453,8 +1483,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -1524,8 +1552,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] INFO: remap base path to [TEST_PATH]/db/common-2 INFO: remap tablespace 1 to [TEST_PATH]/db/tablespace/ts1-2 @@ -1619,6 +1645,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -3110,12 +3138,12 @@ DEBUG: Common:::Lock::lockAquire=>: bResult = true DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = latest, strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = latest/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-5] INFO: remap tablespace 2 to [TEST_PATH]/db/common-2/pg_tblspc/2 DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/global/pg_control, strPathType = db:absolute @@ -3199,6 +3227,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false diff --git a/test/log/backup-synthetic-004.log b/test/log/backup-synthetic-004.log index 2381a9418..522e51684 100644 --- a/test/log/backup-synthetic-004.log +++ b/test/log/backup-synthetic-004.log @@ -429,12 +429,12 @@ DEBUG: Common:::Lock::lockAquire=>: bResult = true DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = [BACKUP-FULL-2], strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-FULL-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-FULL-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -468,16 +468,16 @@ DEBUG: File->exists(): strPath = [TEST_PATH]/db/common, strPathType = db:abs DEBUG: File->exists=>: bExists = true DEBUG: Restore->process: restore in main process DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/base/base1.txt, strPathType = db:absolute -DEBUG: File->exists=>: bExists = true -DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/base/base1.txt, strHashType = , strPathType = db:absolute -DEBUG: File->hashSize=>: iSize = 4, strHash = a3b357a3e395e43fcfb19bb13f3c1b5179279593 - INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches backup (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 -DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute DEBUG: File->exists=>: bExists = false -DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/PG_VERSION.gz, strSourcePathType = backup:cluster, strUser = [USER-1] -DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] -DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strSourcePathType = absolute - INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 +DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/base/base1.txt.gz, strSourcePathType = backup:cluster, strUser = [USER-1] +DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] +DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strSourcePathType = absolute + INFO: restore file [TEST_PATH]/db/common/base/base1.txt (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true +DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/PG_VERSION, strHashType = , strPathType = db:absolute +DEBUG: File->hashSize=>: iSize = 3, strHash = e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION - exists and matches backup (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/recovery.conf, strPathType = db:absolute DEBUG: File->exists=>: bExists = false INFO: wrote [TEST_PATH]/db/common/recovery.conf @@ -488,6 +488,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -496,6 +498,34 @@ DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false -------------------------------------------------------- restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get %f "%p"' +restore delta, force, backup '[BACKUP-FULL-2]', expect exit 115 (fail on missing PG_VERSION) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + WARN: --delta or --force specified but unable to find 'PG_VERSION' or 'backup.manifest' in '[TEST_PATH]/db/common' to confirm that this is a valid $PGDATA directory. --delta and --force have been disabled and if any files exist in the destination directories the restore will be aborted. + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common +ERROR: [115]: cannot restore to path '[TEST_PATH]/db/common' that contains files - try using --delta if this is what you intended + INFO: restore stop + +restore delta, force, backup '[BACKUP-FULL-2]' (restore succeeds with backup.manifest file) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common + INFO: cleanup removed 1 file + INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches size 4 and modification time [MODIFICATION-TIME-2] (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: wrote [TEST_PATH]/db/common/recovery.conf + INFO: restore global/pg_control (copied last to ensure aborted restores cannot be started) + INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 + INFO: restore stop + ++ supplemental file: [TEST_PATH]/db/common/recovery.conf +-------------------------------------------------------- +restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --log-level-console=info --stanza=db archive-get %f "%p"' + incr backup (invalid database version) > [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-start-stop --stanza=db backup ------------------------------------------------------------------------------------------------------------------------------------ @@ -1510,8 +1540,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -1581,8 +1609,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] INFO: remap base path to [TEST_PATH]/db/common-2 INFO: remap tablespace 1 to [TEST_PATH]/db/tablespace/ts1-2 @@ -1676,6 +1702,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -3245,12 +3273,12 @@ DEBUG: Common:::Lock::lockAquire=>: bResult = true DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = latest, strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = latest/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-5] INFO: remap tablespace 2 to [TEST_PATH]/db/common-2/pg_tblspc/2 DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/global/pg_control, strPathType = db:absolute @@ -3334,6 +3362,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false diff --git a/test/log/backup-synthetic-005.log b/test/log/backup-synthetic-005.log index 3bafe1cbf..554cc6afe 100644 --- a/test/log/backup-synthetic-005.log +++ b/test/log/backup-synthetic-005.log @@ -728,12 +728,12 @@ DEBUG: Protocol::CommonMaster->new(): iBufferMax = 4194304, iCompressLevel = DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = [BACKUP-FULL-2], strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-FULL-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-FULL-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -767,16 +767,16 @@ DEBUG: File->exists(): strPath = [TEST_PATH]/db/common, strPathType = db:abs DEBUG: File->exists=>: bExists = true DEBUG: Restore->process: restore in main process DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/base/base1.txt, strPathType = db:absolute -DEBUG: File->exists=>: bExists = true -DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/base/base1.txt, strHashType = , strPathType = db:absolute -DEBUG: File->hashSize=>: iSize = 4, strHash = a3b357a3e395e43fcfb19bb13f3c1b5179279593 - INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches backup (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 -DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute DEBUG: File->exists=>: bExists = false -DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/PG_VERSION, strSourcePathType = backup:cluster, strUser = [USER-1] -DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] -DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strSourcePathType = absolute - INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 +DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/base/base1.txt, strSourcePathType = backup:cluster, strUser = [USER-1] +DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] +DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strSourcePathType = absolute + INFO: restore file [TEST_PATH]/db/common/base/base1.txt (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true +DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/PG_VERSION, strHashType = , strPathType = db:absolute +DEBUG: File->hashSize=>: iSize = 3, strHash = e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION - exists and matches backup (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/recovery.conf, strPathType = db:absolute DEBUG: File->exists=>: bExists = false INFO: wrote [TEST_PATH]/db/common/recovery.conf @@ -787,6 +787,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -795,6 +797,34 @@ DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false -------------------------------------------------------- restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get %f "%p"' +restore delta, force, backup '[BACKUP-FULL-2]', expect exit 115 (fail on missing PG_VERSION) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + WARN: --delta or --force specified but unable to find 'PG_VERSION' or 'backup.manifest' in '[TEST_PATH]/db/common' to confirm that this is a valid $PGDATA directory. --delta and --force have been disabled and if any files exist in the destination directories the restore will be aborted. + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common +ERROR: [115]: cannot restore to path '[TEST_PATH]/db/common' that contains files - try using --delta if this is what you intended + INFO: restore stop + +restore delta, force, backup '[BACKUP-FULL-2]' (restore succeeds with backup.manifest file) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common + INFO: cleanup removed 1 file + INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches size 4 and modification time [MODIFICATION-TIME-2] (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: wrote [TEST_PATH]/db/common/recovery.conf + INFO: restore global/pg_control (copied last to ensure aborted restores cannot be started) + INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 + INFO: restore stop + ++ supplemental file: [TEST_PATH]/db/common/recovery.conf +-------------------------------------------------------- +restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --log-level-console=info --stanza=db archive-get %f "%p"' + incr backup (invalid database version) > [BACKREST_BIN] --config=[TEST_PATH]/backrest/pg_backrest.conf --no-start-stop --stanza=db backup ------------------------------------------------------------------------------------------------------------------------------------ @@ -1885,8 +1915,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -1962,8 +1990,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] INFO: remap base path to [TEST_PATH]/db/common-2 INFO: remap tablespace 1 to [TEST_PATH]/db/tablespace/ts1-2 @@ -2057,6 +2083,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -3739,12 +3767,12 @@ DEBUG: Protocol::CommonMaster->new(): iBufferMax = 4194304, iCompressLevel = DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = latest, strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = latest/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-5] INFO: remap tablespace 2 to [TEST_PATH]/db/common-2/pg_tblspc/2 DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/global/pg_control, strPathType = db:absolute @@ -3828,6 +3856,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false diff --git a/test/log/backup-synthetic-006.log b/test/log/backup-synthetic-006.log index a2818082f..f614d17b9 100644 --- a/test/log/backup-synthetic-006.log +++ b/test/log/backup-synthetic-006.log @@ -491,12 +491,12 @@ DEBUG: Protocol::CommonMaster->new(): iBufferMax = 4194304, iCompressLevel = DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = [BACKUP-FULL-2], strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-FULL-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-FULL-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -530,16 +530,16 @@ DEBUG: File->exists(): strPath = [TEST_PATH]/db/common, strPathType = db:abs DEBUG: File->exists=>: bExists = true DEBUG: Restore->process: restore in main process DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/base/base1.txt, strPathType = db:absolute -DEBUG: File->exists=>: bExists = true -DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/base/base1.txt, strHashType = , strPathType = db:absolute -DEBUG: File->hashSize=>: iSize = 4, strHash = a3b357a3e395e43fcfb19bb13f3c1b5179279593 - INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches backup (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 -DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute DEBUG: File->exists=>: bExists = false -DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/PG_VERSION, strSourcePathType = backup:cluster, strUser = [USER-1] -DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] -DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strSourcePathType = absolute - INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 +DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/base/base1.txt, strSourcePathType = backup:cluster, strUser = [USER-1] +DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] +DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strSourcePathType = absolute + INFO: restore file [TEST_PATH]/db/common/base/base1.txt (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true +DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/PG_VERSION, strHashType = , strPathType = db:absolute +DEBUG: File->hashSize=>: iSize = 3, strHash = e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION - exists and matches backup (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/recovery.conf, strPathType = db:absolute DEBUG: File->exists=>: bExists = false INFO: wrote [TEST_PATH]/db/common/recovery.conf @@ -550,6 +550,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -558,6 +560,34 @@ DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false -------------------------------------------------------- restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get %f "%p"' +restore delta, force, backup '[BACKUP-FULL-2]', expect exit 115 (fail on missing PG_VERSION) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + WARN: --delta or --force specified but unable to find 'PG_VERSION' or 'backup.manifest' in '[TEST_PATH]/db/common' to confirm that this is a valid $PGDATA directory. --delta and --force have been disabled and if any files exist in the destination directories the restore will be aborted. + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common +ERROR: [115]: cannot restore to path '[TEST_PATH]/db/common' that contains files - try using --delta if this is what you intended + INFO: restore stop + +restore delta, force, backup '[BACKUP-FULL-2]' (restore succeeds with backup.manifest file) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common + INFO: cleanup removed 1 file + INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches size 4 and modification time [MODIFICATION-TIME-2] (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: wrote [TEST_PATH]/db/common/recovery.conf + INFO: restore global/pg_control (copied last to ensure aborted restores cannot be started) + INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 + INFO: restore stop + ++ supplemental file: [TEST_PATH]/db/common/recovery.conf +-------------------------------------------------------- +restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --log-level-console=info --stanza=db archive-get %f "%p"' + incr backup (invalid database version) > [BACKREST_BIN] --config=[TEST_PATH]/backrest/pg_backrest.conf --no-start-stop --stanza=db backup ------------------------------------------------------------------------------------------------------------------------------------ @@ -1703,8 +1733,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -1780,8 +1808,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] INFO: remap base path to [TEST_PATH]/db/common-2 INFO: remap tablespace 1 to [TEST_PATH]/db/tablespace/ts1-2 @@ -1875,6 +1901,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -3635,12 +3663,12 @@ DEBUG: Protocol::CommonMaster->new(): iBufferMax = 4194304, iCompressLevel = DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = latest, strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = latest/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-5] INFO: remap tablespace 2 to [TEST_PATH]/db/common-2/pg_tblspc/2 DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/global/pg_control, strPathType = db:absolute @@ -3724,6 +3752,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false diff --git a/test/log/backup-synthetic-007.log b/test/log/backup-synthetic-007.log index cb03de9d8..9f0ba0a23 100644 --- a/test/log/backup-synthetic-007.log +++ b/test/log/backup-synthetic-007.log @@ -485,12 +485,12 @@ DEBUG: Protocol::CommonMaster->new(): iBufferMax = 4194304, iCompressLevel = DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = [BACKUP-FULL-2], strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-FULL-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-FULL-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -524,16 +524,16 @@ DEBUG: File->exists(): strPath = [TEST_PATH]/db/common, strPathType = db:abs DEBUG: File->exists=>: bExists = true DEBUG: Restore->process: restore in main process DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/base/base1.txt, strPathType = db:absolute -DEBUG: File->exists=>: bExists = true -DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/base/base1.txt, strHashType = , strPathType = db:absolute -DEBUG: File->hashSize=>: iSize = 4, strHash = a3b357a3e395e43fcfb19bb13f3c1b5179279593 - INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches backup (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 -DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute DEBUG: File->exists=>: bExists = false -DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/PG_VERSION.gz, strSourcePathType = backup:cluster, strUser = [USER-1] -DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] -DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strSourcePathType = absolute - INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 +DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/base/base1.txt.gz, strSourcePathType = backup:cluster, strUser = [USER-1] +DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] +DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strSourcePathType = absolute + INFO: restore file [TEST_PATH]/db/common/base/base1.txt (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true +DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/PG_VERSION, strHashType = , strPathType = db:absolute +DEBUG: File->hashSize=>: iSize = 3, strHash = e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION - exists and matches backup (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/recovery.conf, strPathType = db:absolute DEBUG: File->exists=>: bExists = false INFO: wrote [TEST_PATH]/db/common/recovery.conf @@ -544,6 +544,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -552,6 +554,34 @@ DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false -------------------------------------------------------- restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get %f "%p"' +restore delta, force, backup '[BACKUP-FULL-2]', expect exit 115 (fail on missing PG_VERSION) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + WARN: --delta or --force specified but unable to find 'PG_VERSION' or 'backup.manifest' in '[TEST_PATH]/db/common' to confirm that this is a valid $PGDATA directory. --delta and --force have been disabled and if any files exist in the destination directories the restore will be aborted. + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common +ERROR: [115]: cannot restore to path '[TEST_PATH]/db/common' that contains files - try using --delta if this is what you intended + INFO: restore stop + +restore delta, force, backup '[BACKUP-FULL-2]' (restore succeeds with backup.manifest file) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common + INFO: cleanup removed 1 file + INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches size 4 and modification time [MODIFICATION-TIME-2] (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: wrote [TEST_PATH]/db/common/recovery.conf + INFO: restore global/pg_control (copied last to ensure aborted restores cannot be started) + INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 + INFO: restore stop + ++ supplemental file: [TEST_PATH]/db/common/recovery.conf +-------------------------------------------------------- +restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --log-level-console=info --stanza=db archive-get %f "%p"' + incr backup (invalid database version) > [BACKREST_BIN] --config=[TEST_PATH]/backrest/pg_backrest.conf --no-start-stop --stanza=db backup ------------------------------------------------------------------------------------------------------------------------------------ @@ -1634,8 +1664,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -1711,8 +1739,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] INFO: remap base path to [TEST_PATH]/db/common-2 INFO: remap tablespace 1 to [TEST_PATH]/db/tablespace/ts1-2 @@ -1806,6 +1832,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -3474,12 +3502,12 @@ DEBUG: Protocol::CommonMaster->new(): iBufferMax = 4194304, iCompressLevel = DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = latest, strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = latest/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-5] INFO: remap tablespace 2 to [TEST_PATH]/db/common-2/pg_tblspc/2 DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/global/pg_control, strPathType = db:absolute @@ -3563,6 +3591,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false diff --git a/test/log/backup-synthetic-008.log b/test/log/backup-synthetic-008.log index 3e6b8a601..f2fd0d31b 100644 --- a/test/log/backup-synthetic-008.log +++ b/test/log/backup-synthetic-008.log @@ -487,12 +487,12 @@ DEBUG: Protocol::CommonMaster->new(): iBufferMax = 4194304, iCompressLevel = DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = [BACKUP-FULL-2], strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-FULL-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-FULL-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -526,16 +526,16 @@ DEBUG: File->exists(): strPath = [TEST_PATH]/db/common, strPathType = db:abs DEBUG: File->exists=>: bExists = true DEBUG: Restore->process: restore in main process DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/base/base1.txt, strPathType = db:absolute -DEBUG: File->exists=>: bExists = true -DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/base/base1.txt, strHashType = , strPathType = db:absolute -DEBUG: File->hashSize=>: iSize = 4, strHash = a3b357a3e395e43fcfb19bb13f3c1b5179279593 - INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches backup (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 -DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute DEBUG: File->exists=>: bExists = false -DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/PG_VERSION.gz, strSourcePathType = backup:cluster, strUser = [USER-1] -DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] -DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/PG_VERSION, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/PG_VERSION.backrest.tmp, strSourcePathType = absolute - INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 +DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [MODIFICATION-TIME-2], strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = db:absolute, strGroup = [GROUP-1], strMode = 0600, strSourceFile = [BACKUP-FULL-2]/base/base/base1.txt.gz, strSourcePathType = backup:cluster, strUser = [USER-1] +DEBUG: File->owner(): strFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] +DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/base/base1.txt, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/base/base1.txt.backrest.tmp, strSourcePathType = absolute + INFO: restore file [TEST_PATH]/db/common/base/base1.txt (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true +DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/PG_VERSION, strHashType = , strPathType = db:absolute +DEBUG: File->hashSize=>: iSize = 3, strHash = e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION - exists and matches backup (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 DEBUG: File->exists(): strPath = [TEST_PATH]/db/common/recovery.conf, strPathType = db:absolute DEBUG: File->exists=>: bExists = false INFO: wrote [TEST_PATH]/db/common/recovery.conf @@ -546,6 +546,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -554,6 +556,34 @@ DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false -------------------------------------------------------- restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get %f "%p"' +restore delta, force, backup '[BACKUP-FULL-2]', expect exit 115 (fail on missing PG_VERSION) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + WARN: --delta or --force specified but unable to find 'PG_VERSION' or 'backup.manifest' in '[TEST_PATH]/db/common' to confirm that this is a valid $PGDATA directory. --delta and --force have been disabled and if any files exist in the destination directories the restore will be aborted. + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common +ERROR: [115]: cannot restore to path '[TEST_PATH]/db/common' that contains files - try using --delta if this is what you intended + INFO: restore stop + +restore delta, force, backup '[BACKUP-FULL-2]' (restore succeeds with backup.manifest file) +> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --force --set=[BACKUP-FULL-2] --log-level-console=info --stanza=db restore +------------------------------------------------------------------------------------------------------------------------------------ + INFO: restore start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --delta --force --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --set=[BACKUP-FULL-2] --stanza=db + INFO: restore backup set [BACKUP-FULL-2] + INFO: check/clean db path [TEST_PATH]/db/common + INFO: cleanup removed 1 file + INFO: restore file [TEST_PATH]/db/common/base/base1.txt - exists and matches size 4 and modification time [MODIFICATION-TIME-2] (4B, 0%) checksum a3b357a3e395e43fcfb19bb13f3c1b5179279593 + INFO: restore file [TEST_PATH]/db/common/PG_VERSION (3B, 0%) checksum e1f7a3a299f62225cba076fc6d3d6e677f303482 + INFO: wrote [TEST_PATH]/db/common/recovery.conf + INFO: restore global/pg_control (copied last to ensure aborted restores cannot be started) + INFO: restore file [TEST_PATH]/db/common/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 + INFO: restore stop + ++ supplemental file: [TEST_PATH]/db/common/recovery.conf +-------------------------------------------------------- +restore_command = '[BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --log-level-console=info --stanza=db archive-get %f "%p"' + incr backup (invalid database version) > [BACKREST_BIN] --config=[TEST_PATH]/backrest/pg_backrest.conf --no-start-stop --stanza=db backup ------------------------------------------------------------------------------------------------------------------------------------ @@ -1691,8 +1721,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common/global/pg_control, strPathType = db:absolute DEBUG: File->remove=>: bRemoved = true @@ -1768,8 +1796,6 @@ DEBUG: File->exists(): strPath = [BACKUP-DIFF-2], strPathType = backup:clust DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = [BACKUP-DIFF-2]/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-2] INFO: remap base path to [TEST_PATH]/db/common-2 INFO: remap tablespace 1 to [TEST_PATH]/db/tablespace/ts1-2 @@ -1863,6 +1889,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false @@ -3609,12 +3637,12 @@ DEBUG: Protocol::CommonMaster->new(): iBufferMax = 4194304, iCompressLevel = DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/postmaster.pid, strPathType = db:absolute DEBUG: File->exists=>: bExists = false +DEBUG: File->exists(): strPath = [TEST_PATH]/db/common-2/PG_VERSION, strPathType = db:absolute +DEBUG: File->exists=>: bExists = true DEBUG: File->exists(): strPath = latest, strPathType = backup:cluster DEBUG: File->exists=>: bExists = true DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = , bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = , lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = latest/backup.manifest, strSourcePathType = backup:cluster, strUser = [undef] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/backup.manifest, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/backup.manifest.backrest.tmp, strSourcePathType = absolute -DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute -DEBUG: File->remove=>: bRemoved = true INFO: restore backup set [BACKUP-DIFF-5] INFO: remap tablespace 2 to [TEST_PATH]/db/common-2/pg_tblspc/2 DEBUG: File->remove(): bIgnoreMissing = , bTemp = [undef], strPath = [TEST_PATH]/db/common-2/global/pg_control, strPathType = db:absolute @@ -3698,6 +3726,8 @@ DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = owner(): strFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strGroup = [GROUP-1], strPathType = absolute, strUser = [USER-1] DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common-2/global/pg_control, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common-2/global/pg_control.backrest.tmp, strSourcePathType = absolute INFO: restore file [TEST_PATH]/db/common-2/global/pg_control (8KB, 100%) checksum 56fe5780b8dca9705e0c22032a83828860a21235 +DEBUG: File->remove(): bIgnoreMissing = false, bTemp = [undef], strPath = [TEST_PATH]/db/common-2/backup.manifest, strPathType = db:absolute +DEBUG: File->remove=>: bRemoved = true DEBUG: Exit::exitSafe(): iExitCode = 0, strSignal = [undef] INFO: restore stop DEBUG: Common:::Lock::lockRelease(): bFailOnNoLock = false