1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00

Require PostgreSQL catalog version when instantiating a Manifest object (and not loading it from disk).

Contributed by Cynthia Shang.
This commit is contained in:
Cynthia Shang 2018-07-16 17:25:15 -04:00 committed by David Steele
parent 4e38cbaea9
commit 0acf705416
13 changed files with 125 additions and 85 deletions

View File

@ -40,6 +40,14 @@
<p>Add <code>iniSectionList()</code> to <code>Ini</code> object and remove dead code.</p>
</release-item>
<release-item>
<release-item-contributor-list>
<release-item-contributor id="shang.cynthia"/>
</release-item-contributor-list>
<p>Require <postgres/> catalog version when instantiating a <code>Manifest</code> object (and not loading it from disk).</p>
</release-item>
</release-development-list>
</release-core-list>

View File

@ -667,7 +667,7 @@ sub process
# Instead just instantiate it. Pass the passphrases to open the manifest and one to encrypt the backup files if the repo is
# encrypted (undefined if not).
my $oBackupManifest = new pgBackRest::Manifest("$strBackupPath/" . FILE_MANIFEST,
{bLoad => false, strDbVersion => $strDbVersion,
{bLoad => false, strDbVersion => $strDbVersion, iDbCatalogVersion => $iCatalogVersion,
strCipherPass => defined($strCipherPassManifest) ? $strCipherPassManifest : undef,
strCipherPassSub => defined($strCipherPassManifest) ? $strCipherPassBackupSet : undef});
@ -687,7 +687,6 @@ sub process
# Database settings
$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_ID, undef, $iDbHistoryId);
$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL, undef, $iControlVersion);
$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iCatalogVersion);
$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID, undef, $ullDbSysId);
# Backup from standby can only be used on PostgreSQL >= 9.1

View File

@ -87,14 +87,12 @@ sub process
# Passing file location dev/null so that the save will fail if it is ever attempted. Pass a miscellaneus value for
# encryption key since the file will not be saved.
my $oBackupManifest = new pgBackRest::Manifest("/dev/null/manifest.chk",
{bLoad => false, strDbVersion => $strDbVersion,
strCipherPass => 'x',
strCipherPassSub => 'x'});
{bLoad => false, strDbVersion => $strDbVersion, iDbCatalogVersion => $iCatalogVersion,
strCipherPass => 'x', strCipherPassSub => 'x'});
# Set required settings not set during manifest instantiation
$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_ID, undef, 1);
$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL, undef, $iControlVersion);
$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iCatalogVersion);
$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID, undef, $ullDbSysId);
$oBackupManifest->build(storageDb({iRemoteIdx => $iRemoteIdx}),

View File

@ -284,6 +284,7 @@ sub new
$bLoad,
$oStorage,
$strDbVersion,
$iDbCatalogVersion,
$strCipherPass, # Passphrase to open the manifest if encrypted
$strCipherPassSub, # Passphrase to encrypt the backup files
) =
@ -294,6 +295,7 @@ sub new
{name => 'bLoad', optional => true, default => true, trace => true},
{name => 'oStorage', optional => true, default => storageRepo(), trace => true},
{name => 'strDbVersion', optional => true, trace => true},
{name => 'iDbCatalogVersion', optional => true, trace => true},
{name => 'strCipherPass', optional => true, redact => true},
{name => 'strCipherPassSub', optional => true, redact => true},
);
@ -302,15 +304,16 @@ sub new
my $self = $class->SUPER::new($strFileName, {bLoad => $bLoad, oStorage => $oStorage, strCipherPass => $strCipherPass,
strCipherPassSub => $strCipherPassSub});
# If manifest not loaded from a file then the db version must be set
# If manifest not loaded from a file then the db version and catalog version must be set
if (!$bLoad)
{
if (!defined($strDbVersion))
if (!(defined($strDbVersion) && defined($iDbCatalogVersion)))
{
confess &log(ASSERT, 'strDbVersion must be provided with bLoad = false');
confess &log(ASSERT, 'strDbVersion and iDbCatalogVersion must be provided with bLoad = false');
}
$self->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, $strDbVersion);
$self->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iDbCatalogVersion);
}
# Return from function and log return values if any

View File

@ -3037,7 +3037,7 @@ static const EmbeddedModule embeddedModule[] =
"\n"
"\n"
"my $oBackupManifest = new pgBackRest::Manifest(\"$strBackupPath/\" . FILE_MANIFEST,\n"
"{bLoad => false, strDbVersion => $strDbVersion,\n"
"{bLoad => false, strDbVersion => $strDbVersion, iDbCatalogVersion => $iCatalogVersion,\n"
"strCipherPass => defined($strCipherPassManifest) ? $strCipherPassManifest : undef,\n"
"strCipherPassSub => defined($strCipherPassManifest) ? $strCipherPassBackupSet : undef});\n"
"\n"
@ -3057,7 +3057,6 @@ static const EmbeddedModule embeddedModule[] =
"\n"
"$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_ID, undef, $iDbHistoryId);\n"
"$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL, undef, $iControlVersion);\n"
"$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iCatalogVersion);\n"
"$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID, undef, $ullDbSysId);\n"
"\n"
"\n"
@ -5356,14 +5355,12 @@ static const EmbeddedModule embeddedModule[] =
"\n"
"\n"
"my $oBackupManifest = new pgBackRest::Manifest(\"/dev/null/manifest.chk\",\n"
"{bLoad => false, strDbVersion => $strDbVersion,\n"
"strCipherPass => 'x',\n"
"strCipherPassSub => 'x'});\n"
"{bLoad => false, strDbVersion => $strDbVersion, iDbCatalogVersion => $iCatalogVersion,\n"
"strCipherPass => 'x', strCipherPassSub => 'x'});\n"
"\n"
"\n"
"$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_ID, undef, 1);\n"
"$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL, undef, $iControlVersion);\n"
"$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iCatalogVersion);\n"
"$oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID, undef, $ullDbSysId);\n"
"\n"
"$oBackupManifest->build(storageDb({iRemoteIdx => $iRemoteIdx}),\n"
@ -13891,6 +13888,7 @@ static const EmbeddedModule embeddedModule[] =
"$bLoad,\n"
"$oStorage,\n"
"$strDbVersion,\n"
"$iDbCatalogVersion,\n"
"$strCipherPass,\n"
"$strCipherPassSub,\n"
") =\n"
@ -13901,6 +13899,7 @@ static const EmbeddedModule embeddedModule[] =
"{name => 'bLoad', optional => true, default => true, trace => true},\n"
"{name => 'oStorage', optional => true, default => storageRepo(), trace => true},\n"
"{name => 'strDbVersion', optional => true, trace => true},\n"
"{name => 'iDbCatalogVersion', optional => true, trace => true},\n"
"{name => 'strCipherPass', optional => true, redact => true},\n"
"{name => 'strCipherPassSub', optional => true, redact => true},\n"
");\n"
@ -13912,12 +13911,13 @@ static const EmbeddedModule embeddedModule[] =
"\n"
"if (!$bLoad)\n"
"{\n"
"if (!defined($strDbVersion))\n"
"if (!(defined($strDbVersion) && defined($iDbCatalogVersion)))\n"
"{\n"
"confess &log(ASSERT, 'strDbVersion must be provided with bLoad = false');\n"
"confess &log(ASSERT, 'strDbVersion and iDbCatalogVersion must be provided with bLoad = false');\n"
"}\n"
"\n"
"$self->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, $strDbVersion);\n"
"$self->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iDbCatalogVersion);\n"
"}\n"
"\n"
"\n"

View File

@ -127,7 +127,7 @@ P00 DEBUG: Storage::Local->list(): bIgnoreMissing = <false>, strExpression
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Storage::Local->list(): bIgnoreMissing = true, strExpression = ^[BACKUP-FULL-1], strPathExp = <REPO:BACKUP>/backup.history/[YEAR-1], strSortOrder = <forward>
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-1]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-1]/backup.manifest
P00 DEBUG: Storage::Local->exists(): strFileExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 DEBUG: Manifest->build(): bOnline = false, bTablespace = [undef], hDatabaseMap = [undef], hTablespaceMap = [undef], oLastManifest = [undef], oStorageDbMaster = [object], strFilter = [undef], strLevel = [undef], strParentPath = [undef], strPath = [TEST_PATH]/db-master/db/base
@ -559,7 +559,7 @@ P00 DEBUG: Storage::Local->list(): bIgnoreMissing = <false>, strExpression
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Storage::Local->list(): bIgnoreMissing = true, strExpression = ^[BACKUP-FULL-2], strPathExp = <REPO:BACKUP>/backup.history/[YEAR-1], strSortOrder = <forward>
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->exists(): strFileExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 DEBUG: Manifest->build(): bOnline = false, bTablespace = [undef], hDatabaseMap = [undef], hTablespaceMap = [undef], oLastManifest = [undef], oStorageDbMaster = [object], strFilter = [undef], strLevel = [undef], strParentPath = [undef], strPath = [TEST_PATH]/db-master/db/base
@ -790,7 +790,7 @@ P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-FUL
P00 DEBUG: Storage::Local->exists=>: bExists = true
P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -803,7 +803,7 @@ P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid=>: bValid = true
P00 DEBUG: Storage::Local->openRead(): bIgnoreMissing = true, rhyFilter = [undef], strCipherPass = [undef], xFileExp = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest.copy
P00 DEBUG: Storage::Base->get(): strCipherPass = [undef], xFile = [object]
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->exists(): strFileExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Storage::Local->exists=>: bExists = true
P00 WARN: --no-online passed and postmaster.pid exists but --force was passed so backup will continue though it looks like the postmaster is running and the backup will probably not be consistent
@ -1175,7 +1175,7 @@ P00 DEBUG: Storage::Local->exists=>: bExists = true
P00 DEBUG: Storage::Local->openRead(): bIgnoreMissing = <false>, rhyFilter = [undef], strCipherPass = [undef], xFileExp = <REPO:BACKUP>/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Base->copy(): xDestinationFile = [TEST_PATH]/db-master/db/base/backup.manifest, xSourceFile = [object]
P00 DEBUG: Storage::Local->openWrite(): bAtomic = <false>, bPathCreate = <false>, lTimestamp = [undef], rhyFilter = [undef], strCipherPass = [undef], strGroup = [undef], strMode = <0640>, strUser = [undef], xFileExp = [TEST_PATH]/db-master/db/base/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = [object], strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/db/base/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = [object], strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/db/base/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/db-master/db/base/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -1877,7 +1877,7 @@ P00 DEBUG: Backup::Info->list=>: stryBackup = ([BACKUP-FULL-2])
P00 DEBUG: Backup::Info->last=>: strBackup = [BACKUP-FULL-2]
P00 DEBUG: Backup::Info->dbHistoryList=>: hDbHash = [hash]
P00 DEBUG: Backup::Info->confirmDb=>: bConfirmDb = true
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -1897,7 +1897,7 @@ P00 DEBUG: Storage::Local->list(): bIgnoreMissing = <false>, strExpression
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Storage::Local->list(): bIgnoreMissing = true, strExpression = [BACKUP-EXPR](D|I)\.manifest\.gz$, strPathExp = <REPO:BACKUP>/backup.history/[YEAR-1], strSortOrder = <forward>
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-INCR-1]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-INCR-1]/backup.manifest
P00 DEBUG: Storage::Local->exists(): strFileExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 WARN: incr backup cannot alter 'checksum-page' option to 'false', reset to 'true' from [BACKUP-FULL-2]
@ -2273,7 +2273,7 @@ P00 DEBUG: Backup::Info->list=>: stryBackup = ([BACKUP-FULL-2])
P00 DEBUG: Backup::Info->last=>: strBackup = [BACKUP-FULL-2]
P00 DEBUG: Backup::Info->dbHistoryList=>: hDbHash = [hash]
P00 DEBUG: Backup::Info->confirmDb=>: bConfirmDb = true
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -2289,7 +2289,7 @@ P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-INC
P00 DEBUG: Storage::Local->exists=>: bExists = true
P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -2302,7 +2302,7 @@ P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid=>: bValid = true
P00 DEBUG: Storage::Local->openRead(): bIgnoreMissing = true, rhyFilter = [undef], strCipherPass = [undef], xFileExp = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-INCR-2]/backup.manifest.copy
P00 DEBUG: Storage::Base->get(): strCipherPass = [undef], xFile = [object]
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/db-master/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Storage::Local->exists(): strFileExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 WARN: incr backup cannot alter 'checksum-page' option to 'false', reset to 'true' from [BACKUP-FULL-2]
@ -3041,7 +3041,7 @@ P00 DEBUG: Storage::Local->exists=>: bExists = true
P00 DEBUG: Storage::Local->openRead(): bIgnoreMissing = <false>, rhyFilter = [undef], strCipherPass = [undef], xFileExp = <REPO:BACKUP>/[BACKUP-DIFF-2]/backup.manifest
P00 DEBUG: Storage::Base->copy(): xDestinationFile = [TEST_PATH]/db-master/db/base-2/backup.manifest, xSourceFile = [object]
P00 DEBUG: Storage::Local->openWrite(): bAtomic = <false>, bPathCreate = <false>, lTimestamp = [undef], rhyFilter = [undef], strCipherPass = [undef], strGroup = [undef], strMode = <0640>, strUser = [undef], xFileExp = [TEST_PATH]/db-master/db/base-2/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = [object], strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/db/base-2/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = [object], strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/db/base-2/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/db-master/db/base-2/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false

View File

@ -122,7 +122,7 @@ P00 DEBUG: Storage::Local->list(): bIgnoreMissing = <false>, strExpression
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Storage::Local->list(): bIgnoreMissing = true, strExpression = ^[BACKUP-FULL-1], strPathExp = <REPO:BACKUP>/backup.history/[YEAR-1], strSortOrder = <forward>
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-1]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-1]/backup.manifest
P00 DEBUG: Protocol::Storage::Remote->exists(): strPathExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Protocol::Storage::Remote->exists=>: bExists = false
P00 DEBUG: Manifest->build(): bOnline = false, bTablespace = [undef], hDatabaseMap = [undef], hTablespaceMap = [undef], oLastManifest = [undef], oStorageDbMaster = [object], strFilter = [undef], strLevel = [undef], strParentPath = [undef], strPath = [TEST_PATH]/db-master/db/base
@ -576,7 +576,7 @@ P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-FUL
P00 DEBUG: Storage::Local->exists=>: bExists = true
P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -589,7 +589,7 @@ P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid=>: bValid = true
P00 DEBUG: Storage::Local->openRead(): bIgnoreMissing = true, rhyFilter = [undef], strCipherPass = [undef], xFileExp = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest.copy
P00 DEBUG: Storage::Base->get(): strCipherPass = [undef], xFile = [object]
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Protocol::Storage::Remote->exists(): strPathExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Protocol::Storage::Remote->exists=>: bExists = false
P00 DEBUG: Manifest->build(): bOnline = false, bTablespace = [undef], hDatabaseMap = [undef], hTablespaceMap = [undef], oLastManifest = [undef], oStorageDbMaster = [object], strFilter = [undef], strLevel = [undef], strParentPath = [undef], strPath = [TEST_PATH]/db-master/db/base
@ -925,7 +925,7 @@ P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-FUL
P00 DEBUG: Storage::Local->exists=>: bExists = true
P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -938,7 +938,7 @@ P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid=>: bValid = true
P00 DEBUG: Storage::Local->openRead(): bIgnoreMissing = true, rhyFilter = [undef], strCipherPass = [undef], xFileExp = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest.copy
P00 DEBUG: Storage::Base->get(): strCipherPass = [undef], xFile = [object]
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Protocol::Storage::Remote->exists(): strPathExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Protocol::Storage::Remote->exists=>: bExists = false
P00 DEBUG: Manifest->build(): bOnline = false, bTablespace = [undef], hDatabaseMap = [undef], hTablespaceMap = [undef], oLastManifest = [undef], oStorageDbMaster = [object], strFilter = [undef], strLevel = [undef], strParentPath = [undef], strPath = [TEST_PATH]/db-master/db/base
@ -1075,7 +1075,7 @@ P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-FUL
P00 DEBUG: Storage::Local->exists=>: bExists = true
P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -1088,7 +1088,7 @@ P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid=>: bValid = true
P00 DEBUG: Storage::Local->openRead(): bIgnoreMissing = true, rhyFilter = [undef], strCipherPass = [undef], xFileExp = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest.copy
P00 DEBUG: Storage::Base->get(): strCipherPass = [undef], xFile = [object]
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Protocol::Storage::Remote->exists(): strPathExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Protocol::Storage::Remote->exists=>: bExists = true
P00 WARN: --no-online passed and postmaster.pid exists but --force was passed so backup will continue though it looks like the postmaster is running and the backup will probably not be consistent
@ -1475,7 +1475,7 @@ P00 DEBUG: Protocol::Storage::Remote->exists=>: bExists = true
P00 DEBUG: Protocol::Storage::Remote->openRead(): rhParam = [hash], strFileExp = <REPO:BACKUP>/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Base->copy(): xDestinationFile = [TEST_PATH]/db-master/db/base/backup.manifest, xSourceFile = [object]
P00 DEBUG: Storage::Local->openWrite(): bAtomic = <false>, bPathCreate = <false>, lTimestamp = [undef], rhyFilter = [undef], strCipherPass = [undef], strGroup = [undef], strMode = <0640>, strUser = [undef], xFileExp = [TEST_PATH]/db-master/db/base/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = [object], strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/db/base/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = [object], strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/db-master/db/base/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/db-master/db/base/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -1950,7 +1950,7 @@ P00 DEBUG: Backup::Info->list=>: stryBackup = ([BACKUP-FULL-2])
P00 DEBUG: Backup::Info->last=>: strBackup = [BACKUP-FULL-2]
P00 DEBUG: Backup::Info->dbHistoryList=>: hDbHash = [hash]
P00 DEBUG: Backup::Info->confirmDb=>: bConfirmDb = true
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -1970,7 +1970,7 @@ P00 DEBUG: Storage::Local->list(): bIgnoreMissing = <false>, strExpression
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Storage::Local->list(): bIgnoreMissing = true, strExpression = [BACKUP-EXPR](D|I)\.manifest\.gz$, strPathExp = <REPO:BACKUP>/backup.history/[YEAR-1], strSortOrder = <forward>
P00 DEBUG: Storage::Local->list=>: stryFileList = ()
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-INCR-1]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-INCR-1]/backup.manifest
P00 DEBUG: Protocol::Storage::Remote->exists(): strPathExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Protocol::Storage::Remote->exists=>: bExists = false
P00 WARN: incr backup cannot alter 'checksum-page' option to 'false', reset to 'true' from [BACKUP-FULL-2]
@ -2363,7 +2363,7 @@ P00 DEBUG: Backup::Info->list=>: stryBackup = ([BACKUP-FULL-2])
P00 DEBUG: Backup::Info->last=>: strBackup = [BACKUP-FULL-2]
P00 DEBUG: Backup::Info->dbHistoryList=>: hDbHash = [hash]
P00 DEBUG: Backup::Info->confirmDb=>: bConfirmDb = true
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-FULL-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -2379,7 +2379,7 @@ P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-INC
P00 DEBUG: Storage::Local->exists=>: bExists = true
P00 DEBUG: Storage::Local->exists(): strFileExp = <REPO:BACKUP>/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Storage::Local->exists=>: bExists = false
P00 DEBUG: Manifest->new(): bLoad = <true>, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = <true>, iDbCatalogVersion = [undef], oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = [undef], strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted(): bIgnoreMissing = true, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Storage::Local->encrypted=>: bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
@ -2392,7 +2392,7 @@ P00 DEBUG: Storage::Local->encryptionValid(): bEncrypted = false
P00 DEBUG: Storage::Local->encryptionValid=>: bValid = true
P00 DEBUG: Storage::Local->openRead(): bIgnoreMissing = true, rhyFilter = [undef], strCipherPass = [undef], xFileExp = [TEST_PATH]/backup/repo/backup/db/[BACKUP-INCR-2]/backup.manifest.copy
P00 DEBUG: Storage::Base->get(): strCipherPass = [undef], xFile = [object]
P00 DEBUG: Manifest->new(): bLoad = false, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Manifest->new(): bLoad = false, iDbCatalogVersion = 201409291, oStorage = <[object]>, strCipherPass = [undef], strCipherPassSub = [undef], strDbVersion = 9.4, strFileName = [TEST_PATH]/backup/repo/backup/db/[BACKUP-INCR-2]/backup.manifest
P00 DEBUG: Protocol::Storage::Remote->exists(): strPathExp = [TEST_PATH]/db-master/db/base/postmaster.pid
P00 DEBUG: Protocol::Storage::Remote->exists=>: bExists = false
P00 WARN: incr backup cannot alter 'checksum-page' option to 'false', reset to 'true' from [BACKUP-FULL-2]

View File

@ -281,6 +281,7 @@ sub backupCreate
my $strManifestFile = "$$oStanza{strBackupClusterPath}/${strBackupLabel}/" . FILE_MANIFEST;
my $oManifest = new pgBackRest::Manifest($strManifestFile, {bLoad => false, strDbVersion => PG_VERSION_93,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_93),
strCipherPass => $strCipherPassManifest, strCipherPassSub => $strCipherPassBackupSet});
# Store information about the backup into the backup section

View File

@ -1811,15 +1811,9 @@ sub restoreCompare
my $oActualManifest = new pgBackRest::Manifest(
"${strTestPath}/" . FILE_MANIFEST,
{bLoad => false, strDbVersion => $oExpectedManifestRef->{&MANIFEST_SECTION_BACKUP_DB}{&MANIFEST_KEY_DB_VERSION},
iDbCatalogVersion => $oExpectedManifestRef->{&MANIFEST_SECTION_BACKUP_DB}{&MANIFEST_KEY_CATALOG},
oStorage => storageTest()});
$oActualManifest->set(
MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef,
$$oExpectedManifestRef{&MANIFEST_SECTION_BACKUP_DB}{&MANIFEST_KEY_DB_VERSION});
$oActualManifest->numericSet(
MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef,
$$oExpectedManifestRef{&MANIFEST_SECTION_BACKUP_DB}{&MANIFEST_KEY_CATALOG});
$oActualManifest->build(storageTest(), $strDbClusterPath, $oLastManifest, false, $oTablespaceMap);
my $strSectionPath = $oActualManifest->get(MANIFEST_SECTION_BACKUP_TARGET, MANIFEST_TARGET_PGDATA, MANIFEST_SUBKEY_PATH);

View File

@ -244,6 +244,7 @@ sub dbCatalogVersion
&PG_VERSION_95 => 201510051,
&PG_VERSION_96 => 201608131,
&PG_VERSION_10 => 201707211,
&PG_VERSION_11 => 201806231,
};
if (!defined($hCatalogVersion->{$strPgVersion}))

View File

@ -142,7 +142,6 @@ sub run
my $strBackupLabel = backupLabelFormat(CFGOPTVAL_BACKUP_TYPE_FULL, undef, 1482000000);
my $strBackupPath = storageRepo->pathGet(STORAGE_REPO_BACKUP . "/${strBackupLabel}");
my $strBackupManifestFile = "$strBackupPath/" . FILE_MANIFEST;
my $iDbCatalogVersion = 201409291;
my $lTime = time() - 10000;
my $strTest = 'test';
@ -151,6 +150,7 @@ sub run
# Section: backup:db
$oManifestBase->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, PG_VERSION_94);
$oManifestBase->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $self->dbCatalogVersion(PG_VERSION_94));
# Section: target:path
my $hDefault = {};
$oManifestBase->set(MANIFEST_SECTION_TARGET_PATH, MANIFEST_TARGET_PGDATA, undef, $hDefault);
@ -166,15 +166,28 @@ sub run
################################################################################################################################
if ($self->begin('new()'))
{
# Missing DB version
# Missing DB and DB Catalog version
#---------------------------------------------------------------------------------------------------------------------------
$self->testException(sub {(new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false}))}, ERROR_ASSERT,
'strDbVersion must be provided with bLoad = false');
'strDbVersion and iDbCatalogVersion must be provided with bLoad = false');
# Missing DB version
#---------------------------------------------------------------------------------------------------------------------------
$self->testException(sub {(new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)}))}, ERROR_ASSERT,
'strDbVersion and iDbCatalogVersion must be provided with bLoad = false');
# Missing DB Catalog version
#---------------------------------------------------------------------------------------------------------------------------
$self->testException(sub {(new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false,
strDbVersion => PG_VERSION_94}))}, ERROR_ASSERT,
'strDbVersion and iDbCatalogVersion must be provided with bLoad = false');
# Successfully instantiate
#---------------------------------------------------------------------------------------------------------------------------
my $oManifest = $self->testResult(sub {(new pgBackRest::Manifest($strBackupManifestFile,
{bLoad => false, strDbVersion => PG_VERSION_94}))}, "[object]", 'manifest instantiated');
{bLoad => false, strDbVersion => PG_VERSION_94, iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)}))},
"[object]", 'manifest instantiated');
# Initialize
#---------------------------------------------------------------------------------------------------------------------------
@ -207,7 +220,8 @@ sub run
################################################################################################################################
if ($self->begin('build()'))
{
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
# Build error if offline = true and no tablespace path
#---------------------------------------------------------------------------------------------------------------------------
@ -391,8 +405,11 @@ sub run
my $oManifestExpectedUnskip = dclone($oManifestExpected);
# Change DB version to 93
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_93});
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_93,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_93)});
$oManifestExpectedUnskip->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, PG_VERSION_93);
$oManifestExpectedUnskip->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef,
$self->dbCatalogVersion(PG_VERSION_93));
# Update expected manifest
$oManifestExpectedUnskip->set(MANIFEST_SECTION_TARGET_FILE . ":default", MANIFEST_SUBKEY_MODE, undef, MODE_0600);
@ -413,8 +430,11 @@ sub run
$self->testResult(sub {$self->manifestCompare($oManifestExpectedUnskip, $oManifest)}, "", 'unskip 94 directories');
# Change DB version to 91
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_91});
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_91,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_91)});
$oManifestExpectedUnskip->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, PG_VERSION_91);
$oManifestExpectedUnskip->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef,
$self->dbCatalogVersion(PG_VERSION_91));
$oManifestExpectedUnskip->set(MANIFEST_SECTION_TARGET_FILE, MANIFEST_PATH_PGSNAPSHOTS . '/' . BOGUS,
MANIFEST_SUBKEY_SIZE, 0);
@ -425,8 +445,11 @@ sub run
$self->testResult(sub {$self->manifestCompare($oManifestExpectedUnskip, $oManifest)}, "", 'unskip 92 directories');
# Change DB version to 90
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_90});
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_90,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_90)});
$oManifestExpectedUnskip->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, PG_VERSION_90);
$oManifestExpectedUnskip->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef,
$self->dbCatalogVersion(PG_VERSION_90));
$oManifestExpectedUnskip->set(MANIFEST_SECTION_TARGET_FILE, MANIFEST_PATH_PGSERIAL . '/' . BOGUS,
MANIFEST_SUBKEY_SIZE, 0);
@ -437,8 +460,11 @@ sub run
$self->testResult(sub {$self->manifestCompare($oManifestExpectedUnskip, $oManifest)}, "", 'unskip 91 directories');
# Change DB version to 84
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_84});
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_84,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_84)});
$oManifestExpectedUnskip->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, PG_VERSION_84);
$oManifestExpectedUnskip->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef,
$self->dbCatalogVersion(PG_VERSION_84));
$oManifestExpectedUnskip->set(MANIFEST_SECTION_TARGET_FILE, MANIFEST_PATH_PGNOTIFY . '/' . BOGUS,
MANIFEST_SUBKEY_SIZE, 0);
@ -449,8 +475,11 @@ sub run
$self->testResult(sub {$self->manifestCompare($oManifestExpectedUnskip, $oManifest)}, "", 'unskip 90 directories');
# Change DB version to 83
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_83});
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_83,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_83)});
$oManifestExpectedUnskip->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, PG_VERSION_83);
$oManifestExpectedUnskip->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef,
$self->dbCatalogVersion(PG_VERSION_83));
$oManifestExpectedUnskip->set(MANIFEST_SECTION_TARGET_FILE, MANIFEST_PATH_PGSTATTMP . '/' . BOGUS,
MANIFEST_SUBKEY_SIZE, 0);
@ -461,7 +490,8 @@ sub run
$self->testResult(sub {$self->manifestCompare($oManifestExpectedUnskip, $oManifest)}, "", 'unskip 84 directories');
# Reset Manifest for next tests
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
$oManifest->build(storageDb(), $self->{strDbPath}, undef, true);
$self->testResult(sub {$self->manifestCompare($oManifestExpected, $oManifest)}, "", 'manifest reset');
@ -498,9 +528,6 @@ sub run
'tablespace symlink ../base destination must not be in $PGDATA');
testFileRemove("${strTblSpcPath}/${strTblspcId}");
# Create the catalog key for the tablespace construction
$oManifest->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iDbCatalogVersion);
# Invalid absolute tablespace is $self->{strDbPath} . /base
# INVESTIGATE: But this should fail because the link points to a directory in pg_data but instead it passes the
# index($hManifest->{$strName}{link_destination}, '/') != 0 and then fails later. It WILL fail "destination must not be in
@ -536,11 +563,8 @@ sub run
testFileRemove("${strTblSpcPath}/${strTblspcId}");
# Reload the manifest otherwise it will contain invalid data from the above exception tests
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
# Set the required db catalog version for tablespaces
$oManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iDbCatalogVersion);
$oManifestExpected->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iDbCatalogVersion);
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
# Create a valid symlink pg_tblspc/1 to tablespace/ts1/1 directory
my $strTablespaceOid = '1';
@ -594,11 +618,13 @@ sub run
# Reload the manifest with version < 9.0
#---------------------------------------------------------------------------------------------------------------------------
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_84});
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_84,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_84)});
# Catalog not stored in < 9.0
$oManifestExpected->remove(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG);
$oManifestExpected->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, PG_VERSION_84);
$oManifestExpected->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef,
$self->dbCatalogVersion(PG_VERSION_84));
# Add unskip directories
$oManifestExpected->set(MANIFEST_SECTION_TARGET_FILE, MANIFEST_PATH_PGDYNSHMEM . '/' . BOGUS,
@ -647,7 +673,8 @@ sub run
################################################################################################################################
if ($self->begin('get/set'))
{
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
# SubKey required but has not been set
#---------------------------------------------------------------------------------------------------------------------------
@ -715,17 +742,15 @@ sub run
# repoPathGet - fully qualified tablespace target
#---------------------------------------------------------------------------------------------------------------------------
# Set the catalog for the DB since that is what is expected to be returned
$oManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iDbCatalogVersion);
$self->testResult(sub {$oManifest->tablespacePathGet()}, "PG_" . PG_VERSION_94 . "_" . $iDbCatalogVersion,
'tablespacePathGet()');
$self->testResult(sub {$oManifest->tablespacePathGet()}, "PG_" . PG_VERSION_94 . "_" .
$self->dbCatalogVersion(PG_VERSION_94), 'tablespacePathGet()');
$oManifest->set(MANIFEST_SECTION_BACKUP_TARGET, $strTablespace, MANIFEST_SUBKEY_TABLESPACE_ID, $strTablespaceId);
$oManifest->set(MANIFEST_SECTION_BACKUP_TARGET, $strTablespace, MANIFEST_SUBKEY_TABLESPACE_NAME, $strTablespaceName);
$oManifest->set(MANIFEST_SECTION_BACKUP_TARGET, $strTablespace, MANIFEST_SUBKEY_TYPE, MANIFEST_VALUE_LINK);
$self->testResult(sub {$oManifest->repoPathGet($strTablespace, BOGUS)}, $strTablespace . "/PG_" . PG_VERSION_94 . "_" .
$iDbCatalogVersion . "/" . BOGUS, 'repoPathGet() - tablespace valid with subpath');
$self->dbCatalogVersion(PG_VERSION_94) . "/" . BOGUS, 'repoPathGet() - tablespace valid with subpath');
# Set the DB version to < 9.0 - there is no special sudirectory in earlier PG versions
$oManifest->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, PG_VERSION_84);
@ -749,7 +774,8 @@ sub run
################################################################################################################################
if ($self->begin('isTarget - exceptions'))
{
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
# Target not defined
#---------------------------------------------------------------------------------------------------------------------------
@ -770,7 +796,8 @@ sub run
{
# dbVersion, xactPath and walPath - PG < 10
#---------------------------------------------------------------------------------------------------------------------------
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
$self->testResult(sub {$oManifest->dbVersion()}, PG_VERSION_94, 'dbVersion < 10');
$self->testResult(sub {$oManifest->xactPath()}, 'pg_clog', ' xactPath - pg_clog');
@ -778,7 +805,8 @@ sub run
# dbVersion, xactPath and walPath - PG >= 10
#---------------------------------------------------------------------------------------------------------------------------
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_10});
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_10,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_10)});
$self->testResult(sub {$oManifest->dbVersion()}, PG_VERSION_10, 'dbVersion >= 10');
$self->testResult(sub {$oManifest->xactPath()}, 'pg_xact', ' xactPath - pg_xact');
@ -788,7 +816,8 @@ sub run
################################################################################################################################
if ($self->begin('validate()'))
{
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
# Set a target:file with only a timestamp - fail size not set
#---------------------------------------------------------------------------------------------------------------------------
@ -816,7 +845,8 @@ sub run
################################################################################################################################
if ($self->begin('future file and last manifest'))
{
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
# Create expected manifest from base
my $oManifestExpected = dclone($oManifestBase);
@ -861,7 +891,8 @@ sub run
$lTime);
# Create a new manifest
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
$oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
$self->testResult(sub {$oManifest->build(storageDb(), $self->{strDbPath}, $oLastManifest, true)}, "[undef]",
'last manifest future timestamp warning', {strLogExpect =>
@ -957,7 +988,8 @@ sub run
################################################################################################################################
if ($self->begin('fileAdd()'))
{
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
my $oManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
my $oManifestExpected = dclone($oManifestBase);
$oManifest->build(storageDb(), $self->{strDbPath}, undef, true);

View File

@ -119,6 +119,7 @@ sub run
# Create a manifest with the pg version to get version-specific paths
my $oManifest = new pgBackRest::Manifest(BOGUS, {bLoad => false, strDbVersion => $self->pgVersion(),
iDbCatalogVersion => $self->dbCatalogVersion($self->pgVersion()),
strCipherPass => $strCipherPass, strCipherPassSub => $bRepoEncrypt ? ENCRYPTION_KEY_BACKUPSET : undef});
# Static backup parameters

View File

@ -272,7 +272,8 @@ sub run
my $strBackupPath = storageRepo->pathGet(STORAGE_REPO_BACKUP . "/${strBackupLabel}");
my $strBackupManifestFile = "$strBackupPath/" . FILE_MANIFEST;
my $oBackupManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94});
my $oBackupManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)});
storageRepo()->pathCreate($strBackupPath);
$oBackupManifest->save();
@ -338,12 +339,13 @@ sub run
#---------------------------------------------------------------------------------------------------------------------------
# Try to create a manifest without a passphrase in an encrypted storage
$self->testException(sub {new pgBackRest::Manifest($strBackupManifestFile,
{bLoad => false, strDbVersion => PG_VERSION_94})}, ERROR_CIPHER,
'passphrase is required when storage is encrypted');
{bLoad => false, strDbVersion => PG_VERSION_94, iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94)})},
ERROR_CIPHER, 'passphrase is required when storage is encrypted');
# Get the encryption passphrase and create the new manifest
my $oBackupInfo = new pgBackRest::Backup::Info($self->{strBackupPath});
$oBackupManifest = new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94),
strCipherPass => $oBackupInfo->cipherPassSub(), strCipherPassSub => cipherPassGen()});
$oBackupManifest->set(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_LABEL, undef, $strBackupLabel);
@ -797,6 +799,7 @@ sub run
my $oBackupInfo = new pgBackRest::Backup::Info($self->{strBackupPath});
$self->testResult(sub {(new pgBackRest::Manifest($strBackupManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94,
iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94),
strCipherPass => $oBackupInfo->cipherPassSub(), strCipherPassSub => 'x'}))->save()},
"[undef]", ' manifest saved');