Commands are run the same as on a single host configuration except that some commands such as backup and expire are run from the backup host instead of the database host.
Create the stanza in the new repository.
@@ -2057,4 +2079,277 @@
+ Upgrading
+
+
+ The following instructions are not meant to be a comprehensive guide for upgrading , rather they will outline the general process for upgrading a master and standby with the intent of demonstrating the steps required to reconfigure . It is recommended that a backup be taken prior to upgrading.
+
+
+ Install new version
+
+
+ {[postgres-install-upgrade]}
+ -y
+
+
+
+ Create the new cluster. If the install creates a default cluster, then remove it to avoid confusion.
+
+
+ Drop default cluster and create the new demo cluster
+
+
+ pg_dropcluster {[pg-version-upgrade]} main
+
+
+
+
+ /usr/lib/postgresql/{[pg-version-upgrade]}/bin/initdb
+ -D {[db-path-upgrade]} -k -A peer
+
+
+
+ {[db-cluster-create-upgrade]}
+
+
+
+ Stop the old cluster on the standby since it will be restored from the newly upgraded cluster to ensure the database system id is identical on both the master and standby. Install the new binaries on the standby and create the cluster.
+
+
+ Stop old cluster
+
+
+ {[db-cluster-stop]}
+
+
+
+ {[postgres-install-upgrade]}
+ -y
+
+
+
+ pg_dropcluster {[pg-version-upgrade]} main
+
+
+
+
+ /usr/lib/postgresql/{[pg-version-upgrade]}/bin/initdb
+ -D {[db-path-upgrade]} -k -A peer
+
+
+
+ {[db-cluster-create-upgrade]}
+
+
+
+ Stop the old cluster on the master and perform the upgrade.
+
+
+ Stop old cluster and perform the upgrade
+
+
+ {[db-cluster-stop]}
+
+
+
+ sh -c 'cd /var/lib/postgresql &&
+ /usr/lib/postgresql/{[pg-version-upgrade]}/bin/pg_upgrade
+ {[dash]}-old-bindir=/usr/lib/postgresql/{[pg-version]}/bin
+ {[dash]}-new-bindir=/usr/lib/postgresql/{[pg-version-upgrade]}/bin
+ {[dash]}-old-datadir={[db-path]}
+ {[dash]}-new-datadir={[db-path-upgrade]}
+ {[dash]}-old-options=" -c config_file={[postgres-config-demo]}"
+ {[dash]}-new-options=" -c config_file={[postgres-config-demo-upgrade]}"'
+
+ Upgrade Complete
+
+
+
+ sh -c 'cd /var/lib/pgsql &&
+ /usr/pgsql-{[pg-version-upgrade]}/bin/pg_upgrade
+ {[dash]}-old-bindir=/usr/pgsql-{[pg-version]}/bin
+ {[dash]}-new-bindir=/usr/pgsql-{[pg-version-upgrade]}/bin
+ {[dash]}-old-datadir={[db-path]}
+ {[dash]}-new-datadir={[db-path-upgrade]}
+ {[dash]}-old-options=" -c config_file={[postgres-config-demo]}"
+ {[dash]}-new-options=" -c config_file={[postgres-config-demo-upgrade]}"'
+
+ Upgrade Complete
+
+
+
+ Configure the new cluster settings and port.
+
+
+ Configure
+
+ '{[project-exe]} {[dash]}-stanza={[postgres-cluster-demo]} archive-push %p'
+ on
+ hot_standby
+ 3
+ '*'
+ ''
+ 5432
+
+
+ Update the configuration on all systems to point to the new cluster.
+
+
+ Upgrade the db-path
+
+ {[db-path-upgrade]}
+
+
+
+ Upgrade the db-path
+
+ {[db-path-upgrade]}
+
+
+
+ Upgrade db1-path and db2-path, disable backup from standby
+
+ {[db-path-upgrade]}
+ {[db-path-upgrade]}
+
+ n
+
+
+
+ Copy hba configuration
+
+
+ cp {[postgres-hba-demo]}
+ {[postgres-hba-demo-upgrade]}
+
+
+
+ Before starting the new cluster, the stanza-upgrade command must be run on the server where the repository is located.
+
+
+ Upgrade the stanza
+
+
+ {[project-exe]} {[dash]}-stanza={[postgres-cluster-demo]} {[dash]}-no-online
+ {[dash]}-log-level-console=info stanza-upgrade
+ completed successfully
+
+
+
+ Start the new cluster and confirm it is successfully installed.
+
+
+ Start new cluster
+
+
+ {[db-cluster-start-upgrade]}
+
+
+
+ Test configuration using the check command. The warning on the backup host regarding the standby being down is expected and can be ignored.
+
+
+ Check configuration
+
+
+ {[db-cluster-check-upgrade]}
+
+
+
+ {[project-exe]} {[dash]}-stanza={[postgres-cluster-demo]} check
+
+
+
+
+ Check configuration
+
+
+ {[project-exe]} {[dash]}-stanza={[postgres-cluster-demo]} check
+
+
+
+ Remove the old clusters.
+
+
+ Remove old cluster
+
+
+ pg_dropcluster {[pg-version]} {[postgres-cluster-demo]}
+
+
+
+ rm -rf {[db-path]}
+
+
+
+
+ Remove old cluster
+
+
+ pg_dropcluster {[pg-version]} {[postgres-cluster-demo]}
+
+
+
+ rm -rf {[db-path]}
+
+
+
+ Run a full backup on the new cluster and then restore the standby from the backup.
+
+
+ Run a full backup
+
+
+ {[project-exe]} {[dash]}-stanza={[postgres-cluster-demo]} {[dash]}-type=full backup
+
+
+
+
+ Restore the {[postgres-cluster-demo]} standby cluster
+
+
+ {[project-exe]} {[dash]}-stanza={[postgres-cluster-demo]} {[dash]}-delta restore
+
+
+
+
+ Configure
+
+ on
+ 5432
+
+
+
+ Configure
+
+ 'postgresql.log'
+ ''
+ true
+ '/etc/ssl/certs/ssl-cert-snakeoil.pem'
+ '/etc/ssl/private/ssl-cert-snakeoil.key'
+
+
+
+ Start
+
+
+ {[db-cluster-start-upgrade]}
+
+
+
+ {[db-cluster-wait]}
+
+
+
+ Backup from standby can be enabled now that the standby is restored.
+
+
+ Reenable backup from standby
+
+ y
+
+
diff --git a/lib/pgBackRest/Archive/ArchiveInfo.pm b/lib/pgBackRest/Archive/ArchiveInfo.pm
index 36e2d325b..8fe44cc4a 100644
--- a/lib/pgBackRest/Archive/ArchiveInfo.pm
+++ b/lib/pgBackRest/Archive/ArchiveInfo.pm
@@ -11,6 +11,7 @@ use parent 'pgBackRest::Common::Ini';
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
+use English '-no_match_vars';
use Exporter qw(import);
use File::Basename qw(dirname basename);
@@ -22,11 +23,11 @@ use pgBackRest::Common::Exception;
use pgBackRest::Common::Ini;
use pgBackRest::Common::Log;
use pgBackRest::Archive::ArchiveCommon;
-use pgBackRest::BackupInfo;
use pgBackRest::Config::Config;
use pgBackRest::DbVersion;
use pgBackRest::File;
use pgBackRest::FileCommon;
+use pgBackRest::InfoCommon;
use pgBackRest::Manifest;
####################################################################################################################################
@@ -41,11 +42,11 @@ use constant ARCHIVE_INFO_FILE => 'archive.
use constant INFO_ARCHIVE_SECTION_DB => INFO_BACKUP_SECTION_DB;
push @EXPORT, qw(INFO_ARCHIVE_SECTION_DB);
use constant INFO_ARCHIVE_SECTION_DB_HISTORY => INFO_BACKUP_SECTION_DB_HISTORY;
- push @EXPORT, qw(INFO_ARCHIVE_SECTION_DB);
+ push @EXPORT, qw(INFO_ARCHIVE_SECTION_DB_HISTORY);
use constant INFO_ARCHIVE_KEY_DB_VERSION => MANIFEST_KEY_DB_VERSION;
push @EXPORT, qw(INFO_ARCHIVE_KEY_DB_VERSION);
-use constant INFO_ARCHIVE_KEY_DB_ID => INFO_BACKUP_KEY_HISTORY_ID;
+use constant INFO_ARCHIVE_KEY_DB_ID => MANIFEST_KEY_DB_ID;
push @EXPORT, qw(INFO_ARCHIVE_KEY_DB_ID);
use constant INFO_ARCHIVE_KEY_DB_SYSTEM_ID => MANIFEST_KEY_SYSTEM_ID;
push @EXPORT, qw(INFO_ARCHIVE_KEY_DB_SYSTEM_ID);
@@ -249,15 +250,25 @@ sub reconstruct
my $strInvalidFileStructure = undef;
- # Get the upper level directory names, e.g. 9.4-1 - don't error if can't find anything
- foreach my $strVersionDir (fileList($self->{strArchiveClusterPath}, REGEX_ARCHIVE_DIR_DB_VERSION, 'forward', true))
+ my @stryArchiveId = fileList($self->{strArchiveClusterPath}, REGEX_ARCHIVE_DIR_DB_VERSION, 'forward', true);
+ my %hDbHistoryVersion;
+
+ # Get the db-version and db-id (history id) from the upper level directory names, e.g. 9.4-1
+ foreach my $strArchiveId (@stryArchiveId)
{
- # Get the db-version and db-id (history id) from the directory name
- my ($strDbVersion, $iDbHistoryId) = split("-", $strVersionDir);
+ my ($strDbVersion, $iDbHistoryId) = split("-", $strArchiveId);
+ $hDbHistoryVersion{$iDbHistoryId} = $strDbVersion;
+ }
+
+ # Loop through the DBs in the order they were created as indicated by the db-id so that the last one is set in the db section
+ foreach my $iDbHistoryId (sort {$a <=> $b} keys %hDbHistoryVersion)
+ {
+ my $strDbVersion = $hDbHistoryVersion{$iDbHistoryId};
+ my $strVersionDir = $strDbVersion . "-" . $iDbHistoryId;
# Get the name of the first archive directory
my $strArchiveDir =
- (fileList($self->{strArchiveClusterPath}."/${strVersionDir}", REGEX_ARCHIVE_DIR_WAL, 'forward', true))[0];
+ (fileList($self->{strArchiveClusterPath} . "/${strVersionDir}", REGEX_ARCHIVE_DIR_WAL, 'forward', true))[0];
# Continue if any file structure or missing files info
if (!defined($strArchiveDir))
@@ -293,7 +304,7 @@ sub reconstruct
if ($strArchiveFile =~ "^.*\.$oFile->{strCompressExtension}\$")
{
- gunzip $hFile => \$tBlock
+ gunzip($hFile => \$tBlock)
or confess &log(ERROR,
"gunzip failed with error: " . $GunzipError .
" on file ${strArchiveFilePath}", ERROR_FILE_READ);
@@ -315,18 +326,39 @@ sub reconstruct
confess &log(ERROR, "unable to read database system identifier", ERROR_FILE_READ);
}
- # ??? For stanza-upgrade, need to test that the history does not already exist
# Fill db section and db history section
$self->dbSectionSet($strDbVersion, $ullDbSysId, $iDbHistoryId);
}
- # ??? This is a precursor for stanza-upgrade: If the DB section does not exist, then there were no valid directories to read
- # from so create the file. Can't raise warning b/c log-log-level console in calling routine is turned off -- determine how to
- # handle cases above where directory structure or files are causing errors
+ # If the DB section does not exist, then there were no valid directories to read from so create the DB and History sections.
if (!$self->test(INFO_ARCHIVE_SECTION_DB))
{
$self->create($strCurrentDbVersion, $ullCurrentDbSysId, false);
}
+ # Else if it does exist but does not match the current DB, then update the DB section
+ else
+ {
+ # Turn off console logging to control when to display the error
+ logDisable();
+
+ eval
+ {
+ $self->check($strCurrentDbVersion, $ullCurrentDbSysId, false);
+ logEnable();
+ return true;
+ }
+ or do
+ {
+ # Reset the console logging
+ logEnable();
+
+ # Confess unhandled errors
+ confess $EVAL_ERROR if (exceptionCode($EVAL_ERROR) != ERROR_ARCHIVE_MISMATCH);
+
+ # Update the DB section if it does not match the current database
+ $self->dbSectionSet($strCurrentDbVersion, $ullCurrentDbSysId, $self->dbHistoryIdGet(false)+1);
+ };
+ }
# Return from function and log return values if any
return logDebugReturn
@@ -375,6 +407,40 @@ sub dbHistoryIdGet
);
}
+####################################################################################################################################
+# dbHistoryList
+#
+# Get the data from the db history section.
+####################################################################################################################################
+sub dbHistoryList
+{
+ my $self = shift;
+ my
+ (
+ $strOperation,
+ ) = logDebugParam
+ (
+ __PACKAGE__ . '->dbHistoryList',
+ );
+
+ my %hDbHash;
+
+ foreach my $iHistoryId ($self->keys(INFO_ARCHIVE_SECTION_DB_HISTORY))
+ {
+ $hDbHash{$iHistoryId}{&INFO_DB_VERSION} =
+ $self->get(INFO_ARCHIVE_SECTION_DB_HISTORY, $iHistoryId, INFO_ARCHIVE_KEY_DB_VERSION);
+ $hDbHash{$iHistoryId}{&INFO_SYSTEM_ID} =
+ $self->get(INFO_ARCHIVE_SECTION_DB_HISTORY, $iHistoryId, INFO_ARCHIVE_KEY_DB_ID);
+ }
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'hDbHash', value => \%hDbHash}
+ );
+}
+
####################################################################################################################################
# dbSectionSet
#
diff --git a/lib/pgBackRest/BackupInfo.pm b/lib/pgBackRest/BackupInfo.pm
index d7f30654c..4ad4e470d 100644
--- a/lib/pgBackRest/BackupInfo.pm
+++ b/lib/pgBackRest/BackupInfo.pm
@@ -7,12 +7,14 @@ use parent 'pgBackRest::Common::Ini';
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
+use English '-no_match_vars';
use Exporter qw(import);
our @EXPORT = qw();
use File::Basename qw(dirname basename);
use File::stat;
+use pgBackRest::Archive::ArchiveInfo;
use pgBackRest::BackupCommon;
use pgBackRest::Common::Exception;
use pgBackRest::Common::Ini;
@@ -20,6 +22,7 @@ use pgBackRest::Common::Log;
use pgBackRest::Config::Config;
use pgBackRest::File;
use pgBackRest::FileCommon;
+use pgBackRest::InfoCommon;
use pgBackRest::Manifest;
use pgBackRest::Protocol::Common;
use pgBackRest::Protocol::Protocol;
@@ -37,10 +40,6 @@ use constant INFO_BACKUP_SECTION_BACKUP => MANIFEST_
push @EXPORT, qw(INFO_BACKUP_SECTION_BACKUP);
use constant INFO_BACKUP_SECTION_BACKUP_CURRENT => INFO_BACKUP_SECTION_BACKUP . ':current';
push @EXPORT, qw(INFO_BACKUP_SECTION_BACKUP_CURRENT);
-use constant INFO_BACKUP_SECTION_DB => 'db';
- push @EXPORT, qw(INFO_BACKUP_SECTION_DB);
-use constant INFO_BACKUP_SECTION_DB_HISTORY => INFO_BACKUP_SECTION_DB . ':history';
- push @EXPORT, qw(INFO_BACKUP_SECTION_DB_HISTORY);
use constant INFO_BACKUP_KEY_ARCHIVE_CHECK => MANIFEST_KEY_ARCHIVE_CHECK;
push @EXPORT, qw(INFO_BACKUP_KEY_ARCHIVE_CHECK);
@@ -192,13 +191,21 @@ sub reconstruct
(
$strOperation,
$bSave,
- $bRequired,
+ $bRequired, # If false then must be creating or reconstructing so the DB info must be supplied
+ $strDbVersion,
+ $ullDbSysId,
+ $iControlVersion,
+ $iCatalogVersion,
) =
logDebugParam
(
__PACKAGE__ . '->reconstruct', \@_,
{name => 'bSave', default => true},
{name => 'bRequired', default => true},
+ {name => 'strDbVersion', required => false},
+ {name => 'ullDbSysId', required => false},
+ {name => 'iControlVersion', required => false},
+ {name => 'iCatalogVersion', required => false},
);
# Check for backups that are not in FILE_BACKUP_INFO
@@ -211,13 +218,80 @@ sub reconstruct
if (!$self->current($strBackup) && fileExists($strManifestFile))
{
- &log(WARN, "backup ${strBackup} found in repository added to " . FILE_BACKUP_INFO);
my $oManifest = pgBackRest::Manifest->new($strManifestFile);
+ # If we are reconstructing, then we need to be sure this db-id and version is in the history section. Also if it
+ # has a db-id greater than anything in the history section, then add it to the db section.
+ if (!$bRequired)
+ {
+ my $hDbList = $self->dbHistoryList();
+ my $iDbId = $oManifest->get(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_ID);
+ my $iDbIdMax = 0;
+ my $ullDbSysId = $oManifest->get(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID);
+ my $strDbVersion = $oManifest->get(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION);
+
+ # If this is the max history id then set the db section
+ foreach my $iDbHistoryId (keys %{$hDbList})
+ {
+ # If the current history ID is greater than the running max, then set it to the current id
+ if ($iDbHistoryId > $iDbIdMax)
+ {
+ $iDbIdMax = $iDbHistoryId;
+ }
+ }
+
+ if ($iDbId >= $iDbIdMax)
+ {
+ $self->dbSectionSet($strDbVersion, $oManifest->get(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL),
+ $oManifest->get(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG), $ullDbSysId, $iDbId);
+ }
+ }
+
+ &log(WARN, "backup ${strBackup} found in repository added to " . FILE_BACKUP_INFO);
+
$self->add($oManifest, $bSave, $bRequired);
}
}
+ # If reconstructing, make sure the DB section is correct
+ if (!$bRequired)
+ {
+ # If any database info is missing, then assert
+ if (!defined($strDbVersion) || !defined($ullDbSysId) || !defined($iControlVersion) || !defined($iCatalogVersion))
+ {
+ confess &log(ASSERT, "backup info cannot be reconstructed without database information");
+ }
+ # If the DB section does not exist then create the db and history section
+ elsif (!$self->test(INFO_BACKUP_SECTION_DB))
+ {
+ $self->create($strDbVersion, $ullDbSysId, $iControlVersion, $iCatalogVersion, $bSave);
+ }
+ # Else update the DB section if it does not match the current database
+ else
+ {
+ # Turn off console logging to control when to display the error
+ logDisable();
+
+ eval
+ {
+ $self->check($strDbVersion, $iControlVersion, $iCatalogVersion, $ullDbSysId, $bRequired);
+ logEnable();
+ return true;
+ }
+ or do
+ {
+ # Reset the console logging
+ logEnable();
+
+ # Confess unhandled errors
+ confess $EVAL_ERROR if (exceptionCode($EVAL_ERROR) != ERROR_BACKUP_MISMATCH);
+
+ # Update the DB section if it does not match the current database
+ $self->dbSectionSet($strDbVersion, $iControlVersion, $iCatalogVersion, $ullDbSysId, $self->dbHistoryIdGet(false)+1);
+ };
+ }
+ }
+
# Remove backups from FILE_BACKUP_INFO that are no longer in the repository
foreach my $strBackup ($self->keys(INFO_BACKUP_SECTION_BACKUP_CURRENT))
{
@@ -404,8 +478,18 @@ sub add
$oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE));
$self->set(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_VERSION,
$oBackupManifest->get(INI_SECTION_BACKREST, INI_KEY_VERSION));
- $self->set(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_HISTORY_ID,
- $self->get(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_HISTORY_ID));
+
+ if ($bRequired)
+ {
+ $self->set(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_HISTORY_ID,
+ $self->get(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_HISTORY_ID));
+ }
+ # If we are reconstructing, then the history id must be taken from the manifest
+ else
+ {
+ $self->set(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_HISTORY_ID,
+ $oBackupManifest->get(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_ID));
+ }
if (!$oBackupManifest->test(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE, undef, BACKUP_TYPE_FULL))
{
@@ -505,6 +589,138 @@ sub list
);
}
+####################################################################################################################################
+# backupArchiveDbHistoryId
+#
+# Gets the backup.info db-id for the archiveId passed.
+####################################################################################################################################
+sub backupArchiveDbHistoryId
+{
+ my $self = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strArchiveId,
+ $strPathBackupArchive,
+ ) =
+ logDebugParam
+ (
+ __PACKAGE__ . '->backupArchiveDbHistoryId', \@_,
+ {name => 'strArchiveId'},
+ {name => 'strPathBackupArchive'},
+ );
+
+ # List of backups associated with the db-id provided
+ my @stryArchiveBackup;
+
+ # Build the db list from the history in the backup info and archive info file
+ my $oArchiveInfo = new pgBackRest::Archive::ArchiveInfo($strPathBackupArchive, true);
+ my $hDbListArchive = $oArchiveInfo->dbHistoryList();
+ my $hDbListBackup = $self->dbHistoryList();
+ my $iDbHistoryId = undef;
+
+ # Get the db-version and db-id (history id) from the archiveId
+ my ($strDbVersionArchive, $iDbIdArchive) = split("-", $strArchiveId);
+
+ # Get the DB system ID to map back to the backup info
+ my $ullDbSysIdArchive = $$hDbListArchive{$iDbIdArchive}{&INFO_SYSTEM_ID};
+
+ # Get the db-id from backup info history that corresponds to the archive db-version and db-system-id
+ foreach my $iDbIdBackup (keys %{$hDbListBackup})
+ {
+ if ($$hDbListBackup{$iDbIdBackup}{&INFO_SYSTEM_ID} == $ullDbSysIdArchive &&
+ $$hDbListBackup{$iDbIdBackup}{&INFO_DB_VERSION} eq $strDbVersionArchive)
+ {
+ $iDbHistoryId = $iDbIdBackup;
+ last;
+ }
+ }
+
+ # If the database is not found in the backup.info history list
+ if (!defined($iDbHistoryId))
+ {
+ # Check to see that the current DB sections match for the archive and backup info files
+ if (!($oArchiveInfo->test(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_VERSION, undef,
+ ($self->get(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_DB_VERSION)))) ||
+ !($oArchiveInfo->test(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_SYSTEM_ID, undef,
+ ($self->get(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_SYSTEM_ID)))))
+ {
+ # This should never happen unless the backup.info file is corrupt
+ confess &log(ASSERT, "the archive and backup database sections do not match", ERROR_FILE_INVALID);
+ }
+ }
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'iDbHistoryId', value => $iDbHistoryId}
+ );
+}
+
+####################################################################################################################################
+# listByArchiveId
+#
+# Filters a list of backups by the archiveId passed.
+####################################################################################################################################
+sub listByArchiveId
+{
+ my $self = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strArchiveId,
+ $strPathBackupArchive,
+ $stryBackup,
+ $strOrder,
+ ) =
+ logDebugParam
+ (
+ __PACKAGE__ . '->listByArchiveId', \@_,
+ {name => 'strArchiveId'},
+ {name => 'strPathBackupArchive'},
+ {name => 'stryBackup'},
+ {name => 'strOrder', default => 'forward'}
+ );
+
+ # List of backups associated with the db-id provided
+ my @stryArchiveBackup;
+
+ my $iDbHistoryId = $self->backupArchiveDbHistoryId($strArchiveId, $strPathBackupArchive);
+
+ # If history found, then build list of backups associated with the archive id passed, else return empty array
+ if (defined($iDbHistoryId))
+ {
+ # Iterate through the backups and filter
+ foreach my $strBackup (@$stryBackup)
+ {
+ # From the backup.info current backup section, get the db-id for the backup and if it is the same, add to the list
+ if ($self->test(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_HISTORY_ID, $iDbHistoryId))
+ {
+ if ($strOrder eq 'reverse')
+ {
+ unshift(@stryArchiveBackup, $strBackup)
+ }
+ else
+ {
+ push(@stryArchiveBackup, $strBackup)
+ }
+ }
+ }
+ }
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'stryArchiveBackup', value => \@stryArchiveBackup}
+ );
+}
+
####################################################################################################################################
# last
#
@@ -643,6 +859,40 @@ sub dbHistoryIdGet
);
}
+####################################################################################################################################
+# dbHistoryList
+#
+# Get the data from the db history section.
+####################################################################################################################################
+sub dbHistoryList
+{
+ my $self = shift;
+ my
+ (
+ $strOperation,
+ ) = logDebugParam
+ (
+ __PACKAGE__ . '->dbHistoryList',
+ );
+
+ my %hDbHash;
+
+ foreach my $iHistoryId ($self->keys(INFO_BACKUP_SECTION_DB_HISTORY))
+ {
+ $hDbHash{$iHistoryId}{&INFO_DB_VERSION} =
+ $self->get(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_DB_VERSION);
+ $hDbHash{$iHistoryId}{&INFO_SYSTEM_ID} =
+ $self->get(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_SYSTEM_ID);
+ }
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'hDbHash', value => \%hDbHash}
+ );
+}
+
####################################################################################################################################
# dbSectionSet
#
diff --git a/lib/pgBackRest/Check/Check.pm b/lib/pgBackRest/Check/Check.pm
index fa94bf1cf..824f0959e 100644
--- a/lib/pgBackRest/Check/Check.pm
+++ b/lib/pgBackRest/Check/Check.pm
@@ -197,7 +197,7 @@ sub backupInfoCheck
) =
logDebugParam
(
- __PACKAGE__ . '->getBackupInfoCheck', \@_,
+ __PACKAGE__ . '->backupInfoCheck', \@_,
{name => 'oFile'},
{name => 'strDbVersion', required => false},
{name => 'iControlVersion', required => false},
diff --git a/lib/pgBackRest/Config/Config.pm b/lib/pgBackRest/Config/Config.pm
index 2d774c6f7..4c4597f57 100644
--- a/lib/pgBackRest/Config/Config.pm
+++ b/lib/pgBackRest/Config/Config.pm
@@ -60,6 +60,9 @@ use constant CMD_RESTORE => 'restore'
use constant CMD_STANZA_CREATE => 'stanza-create';
push @EXPORT, qw(CMD_STANZA_CREATE);
$oCommandHash{&CMD_STANZA_CREATE} = true;
+use constant CMD_STANZA_UPGRADE => 'stanza-upgrade';
+ push @EXPORT, qw(CMD_STANZA_UPGRADE);
+ $oCommandHash{&CMD_STANZA_UPGRADE} = true;
use constant CMD_START => 'start';
push @EXPORT, qw(CMD_START);
$oCommandHash{&CMD_START} = true;
@@ -611,6 +614,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true
}
@@ -670,6 +674,7 @@ my %oOptionRule =
&CMD_BACKUP => true,
&CMD_CHECK => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
}
},
@@ -730,6 +735,10 @@ my %oOptionRule =
{
&OPTION_RULE_REQUIRED => true
},
+ &CMD_STANZA_UPGRADE =>
+ {
+ &OPTION_RULE_REQUIRED => true
+ },
&CMD_START =>
{
&OPTION_RULE_REQUIRED => false
@@ -1012,6 +1021,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
}
},
@@ -1033,6 +1043,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => false,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
}
},
@@ -1069,6 +1080,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
}
},
@@ -1090,6 +1102,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
}
},
@@ -1110,6 +1123,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => false,
&CMD_STOP => false
}
@@ -1130,6 +1144,7 @@ my %oOptionRule =
&CMD_LOCAL => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
&CMD_EXPIRE => true,
@@ -1145,7 +1160,6 @@ my %oOptionRule =
{
&CMD_ARCHIVE_GET => true,
&CMD_ARCHIVE_PUSH => true,
- &CMD_STANZA_CREATE => true,
&CMD_BACKUP => true,
&CMD_EXPIRE => true,
&CMD_INFO => true,
@@ -1153,6 +1167,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
},
@@ -1175,6 +1190,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
},
@@ -1191,6 +1207,7 @@ my %oOptionRule =
&CMD_ARCHIVE_PUSH => true,
&CMD_BACKUP => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
},
},
@@ -1212,6 +1229,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
}
},
@@ -1243,6 +1261,7 @@ my %oOptionRule =
&CMD_REMOTE => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
},
@@ -1306,6 +1325,7 @@ my %oOptionRule =
&CMD_INFO => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true
}
@@ -1336,6 +1356,7 @@ my %oOptionRule =
&CMD_INFO => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true
}
@@ -1478,6 +1499,7 @@ my %oOptionRule =
&CMD_LOCAL => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
},
@@ -1502,6 +1524,7 @@ my %oOptionRule =
&CMD_LOCAL => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
},
@@ -1527,6 +1550,7 @@ my %oOptionRule =
&CMD_LOCAL => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
},
@@ -1542,6 +1566,7 @@ my %oOptionRule =
&CMD_BACKUP => true,
&CMD_CHECK => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
},
},
@@ -1789,6 +1814,7 @@ my %oOptionRule =
&CMD_EXPIRE => true,
&CMD_LOCAL => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
},
@@ -1811,6 +1837,7 @@ my %oOptionRule =
&CMD_EXPIRE => true,
&CMD_LOCAL => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
},
@@ -1834,6 +1861,7 @@ my %oOptionRule =
&CMD_EXPIRE => true,
&CMD_LOCAL => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
&CMD_START => true,
&CMD_STOP => true,
}
@@ -1860,6 +1888,7 @@ my %oOptionRule =
&CMD_CHECK => true,
&CMD_RESTORE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
},
},
@@ -1875,6 +1904,7 @@ my %oOptionRule =
&CMD_CHECK => true,
&CMD_REMOTE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
}
},
@@ -1891,6 +1921,7 @@ my %oOptionRule =
&CMD_LOCAL => true,
&CMD_REMOTE => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
}
},
@@ -1906,6 +1937,7 @@ my %oOptionRule =
&CMD_CHECK => true,
&CMD_LOCAL => true,
&CMD_STANZA_CREATE => true,
+ &CMD_STANZA_UPGRADE => true,
},
&OPTION_RULE_REQUIRED => false,
&OPTION_RULE_DEPEND =>
diff --git a/lib/pgBackRest/Config/ConfigHelpData.pm b/lib/pgBackRest/Config/ConfigHelpData.pm
index 6ec0d320d..cce19d902 100644
--- a/lib/pgBackRest/Config/ConfigHelpData.pm
+++ b/lib/pgBackRest/Config/ConfigHelpData.pm
@@ -1346,6 +1346,49 @@ my $oConfigHelpData =
}
},
+ # STANZA-UPGRADE Command Help
+ #---------------------------------------------------------------------------------------------------------------------------
+ 'stanza-upgrade' =>
+ {
+ summary =>
+ "Upgrade a stanza.",
+ description =>
+ "Immediately after upgrading PostgreSQL to a newer major version, the db-path for all pgBackRest configurations " .
+ "must be set to the new database location and the stanza-upgrade run on the backup host. If the database is " .
+ "offline use the --no-online option.",
+
+ option =>
+ {
+ 'backup-cmd' => 'section',
+ 'backup-config' => 'section',
+ 'backup-host' => 'section',
+ 'backup-standby' => 'section',
+ 'buffer-size' => 'section',
+ 'cmd-ssh' => 'section',
+ 'compress-level' => 'section',
+ 'compress-level-network' => 'section',
+ 'config' => 'default',
+ 'db-cmd' => 'section',
+ 'db-config' => 'section',
+ 'db-host' => 'section',
+ 'db-path' => 'section',
+ 'db-port' => 'section',
+ 'db-socket-path' => 'section',
+ 'db-timeout' => 'section',
+ 'db-user' => 'section',
+ 'lock-path' => 'section',
+ 'log-level-console' => 'section',
+ 'log-level-file' => 'section',
+ 'log-path' => 'section',
+ 'neutral-umask' => 'section',
+ 'online' => 'default',
+ 'protocol-timeout' => 'section',
+ 'repo-path' => 'section',
+ 'repo-sync' => 'section',
+ 'stanza' => 'default'
+ }
+ },
+
# START Command Help
#---------------------------------------------------------------------------------------------------------------------------
'start' =>
diff --git a/lib/pgBackRest/Expire.pm b/lib/pgBackRest/Expire.pm
index b25a791ad..d172d0053 100644
--- a/lib/pgBackRest/Expire.pm
+++ b/lib/pgBackRest/Expire.pm
@@ -16,11 +16,13 @@ use pgBackRest::Common::Exception;
use pgBackRest::Common::Log;
use pgBackRest::Archive::ArchiveCommon;
use pgBackRest::Archive::ArchiveGet;
+use pgBackRest::Archive::ArchiveInfo;
use pgBackRest::BackupCommon;
use pgBackRest::BackupInfo;
use pgBackRest::Config::Config;
use pgBackRest::File;
use pgBackRest::FileCommon;
+use pgBackRest::InfoCommon;
use pgBackRest::Manifest;
use pgBackRest::Protocol::Common;
use pgBackRest::Protocol::Protocol;
@@ -238,158 +240,237 @@ sub process
}
else
{
+ my @stryGlobalBackupRetention;
+
# Determine which backup type to use for archive retention (full, differential, incremental) and get a list of the
# remaining non-expired backups based on the type.
if ($strArchiveRetentionType eq BACKUP_TYPE_FULL)
{
- @stryPath = $oBackupInfo->list(backupRegExpGet(true), 'reverse');
+ @stryGlobalBackupRetention = $oBackupInfo->list(backupRegExpGet(true), 'reverse');
}
elsif ($strArchiveRetentionType eq BACKUP_TYPE_DIFF)
{
- @stryPath = $oBackupInfo->list(backupRegExpGet(true, true), 'reverse');
+ @stryGlobalBackupRetention = $oBackupInfo->list(backupRegExpGet(true, true), 'reverse');
}
elsif ($strArchiveRetentionType eq BACKUP_TYPE_INCR)
{
- @stryPath = $oBackupInfo->list(backupRegExpGet(true, true, true), 'reverse');
+ @stryGlobalBackupRetention = $oBackupInfo->list(backupRegExpGet(true, true, true), 'reverse');
}
# If no backups were found then preserve current archive logs - too soon to expire them
- my $iBackupTotal = scalar @stryPath;
+ my $iBackupTotal = scalar @stryGlobalBackupRetention;
if ($iBackupTotal > 0)
{
- # See if enough backups exist for expiration to start
- my $strArchiveRetentionBackup = $stryPath[$iArchiveRetention - 1];
+ my $oArchiveInfo = new pgBackRest::Archive::ArchiveInfo($oFile->pathGet(PATH_BACKUP_ARCHIVE), true);
+ my @stryListArchiveDisk = fileList($oFile->pathGet(PATH_BACKUP_ARCHIVE), REGEX_ARCHIVE_DIR_DB_VERSION, 'forward', true);
- if (!defined($strArchiveRetentionBackup))
+ # Make sure the current database versions match between the two files
+ if (!($oArchiveInfo->test(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_VERSION, undef,
+ ($oBackupInfo->get(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_DB_VERSION)))) ||
+ !($oArchiveInfo->test(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_SYSTEM_ID, undef,
+ ($oBackupInfo->get(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_SYSTEM_ID)))))
{
- if ($strArchiveRetentionType eq BACKUP_TYPE_FULL && scalar @stryPath > 0)
- {
- &log(INFO, "full backup total < ${iArchiveRetention} - using oldest full backup for archive retention");
- $strArchiveRetentionBackup = $stryPath[scalar @stryPath - 1];
- }
+ confess &log(ERROR, "archive and backup database versions do not match\n" .
+ "HINT: has a stanza-upgrade been performed?", ERROR_FILE_INVALID);
}
- # If a backup has been selected for retention then continue
- if (defined($strArchiveRetentionBackup))
+ # Get the list of backups that are part of archive retention
+ my @stryTmp = @stryGlobalBackupRetention;
+ my @stryGlobalBackupArchiveRetention = splice(@stryTmp, 0, $iArchiveRetention);
+
+ # For each archiveId, remove WAL that are not part of retention
+ foreach my $strArchiveId (@stryListArchiveDisk)
{
- my $bRemove;
+ # From the global list of backups to retain, create a list of backups, oldest to newest, associated with this
+ # archiveId (e.g. 9.4-1)
+ my @stryLocalBackupRetention = $oBackupInfo->listByArchiveId($strArchiveId,
+ $oFile->pathGet(PATH_BACKUP_ARCHIVE), \@stryGlobalBackupRetention, 'reverse');
- # Only expire if the selected backup has archive info - backups performed with --no-online will
- # not have archive info and cannot be used for expiration.
- if ($oBackupInfo->test(INFO_BACKUP_SECTION_BACKUP_CURRENT,
- $strArchiveRetentionBackup, INFO_BACKUP_KEY_ARCHIVE_START))
+ # If no backup to retain was found
+ if (!@stryLocalBackupRetention)
{
- # Get archive id
- my $strArchiveId = new pgBackRest::Archive::ArchiveGet()->getArchiveId($oFile);
+ # Get the backup db-id corresponding to this archiveId
+ my $iDbHistoryId = $oBackupInfo->backupArchiveDbHistoryId($strArchiveId, $oFile->pathGet(PATH_BACKUP_ARCHIVE));
- # Get archive ranges to preserve. Because archive retention can be less than total retention it is important
- # to preserve archive that is required to make the older backups consistent even though they cannot be played
- # any further forward with PITR.
- my $strArchiveExpireMax;
- my @oyArchiveRange;
-
- foreach my $strBackup ($oBackupInfo->list())
+ # If this is not the current database, then delete the archive directory else do nothing since the current
+ # DB archive directory must not be deleted
+ if (!defined($iDbHistoryId) || !$oBackupInfo->test(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_HISTORY_ID, undef,
+ $iDbHistoryId))
{
- if ($strBackup le $strArchiveRetentionBackup &&
- $oBackupInfo->test(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_ARCHIVE_START))
- {
- my $oArchiveRange = {};
+ my $strFullPath = $oFile->pathGet(PATH_BACKUP_ARCHIVE, $strArchiveId);
- $$oArchiveRange{start} = $oBackupInfo->get(INFO_BACKUP_SECTION_BACKUP_CURRENT,
- $strBackup, INFO_BACKUP_KEY_ARCHIVE_START);
+ remove_tree($strFullPath) > 0
+ or confess &log(ERROR, "unable to remove orphaned ${strFullPath}", ERROR_PATH_REMOVE);
- if ($strBackup ne $strArchiveRetentionBackup)
- {
- $$oArchiveRange{stop} = $oBackupInfo->get(INFO_BACKUP_SECTION_BACKUP_CURRENT,
- $strBackup, INFO_BACKUP_KEY_ARCHIVE_STOP);
- }
- else
- {
- $strArchiveExpireMax = $$oArchiveRange{start};
- }
-
- &log(DETAIL, "archive retention on backup ${strBackup}, start = $$oArchiveRange{start}" .
- (defined($$oArchiveRange{stop}) ? ", stop = $$oArchiveRange{stop}" : ''));
-
- push(@oyArchiveRange, $oArchiveRange);
- }
+ &log(INFO, "removed orphaned archive path: ${strFullPath}");
}
- # Get all major archive paths (timeline and first 64 bits of LSN)
- foreach my $strPath ($oFile->list(PATH_BACKUP_ARCHIVE, $strArchiveId, REGEX_ARCHIVE_DIR_WAL))
- {
- logDebugMisc($strOperation, "found major WAL path: ${strPath}");
- $bRemove = true;
+ # Continue to next directory
+ next;
+ }
- # Keep the path if it falls in the range of any backup in retention
- foreach my $oArchiveRange (@oyArchiveRange)
+ my @stryLocalBackupArchiveRentention;
+
+ # If the archive retention is less than or equal to the number of all backups, then perform selective expiration
+ if (@stryGlobalBackupArchiveRetention && $iArchiveRetention <= scalar @stryGlobalBackupRetention)
+ {
+ # From the full list of backups in archive retention, find the intersection of local backups to retain
+ foreach my $strGlobalBackupArchiveRetention (@stryGlobalBackupArchiveRetention)
+ {
+ foreach my $strLocalBackupRetention (@stryLocalBackupRetention)
{
- if ($strPath ge substr($$oArchiveRange{start}, 0, 16) &&
- (!defined($$oArchiveRange{stop}) || $strPath le substr($$oArchiveRange{stop}, 0, 16)))
+ if ($strLocalBackupRetention eq $strGlobalBackupArchiveRetention)
{
- $bRemove = false;
- last;
+ unshift(@stryLocalBackupArchiveRentention, $strLocalBackupRetention);
}
}
+ }
+ }
+ # Else if there are not enough backups yet globally to start archive expiration then set the archive retention
+ # to the oldest backup so anything prior to that will be removed as it is not needed but everything else is
+ # This is incase there are old archives left around so that they don't stay around forever
+ else
+ {
+ if ($strArchiveRetentionType eq BACKUP_TYPE_FULL && scalar @stryLocalBackupRetention > 0)
+ {
+ &log(INFO, "full backup total < ${iArchiveRetention} - using oldest full backup for ${strArchiveId} " .
+ " archive retention");
+ $stryLocalBackupArchiveRentention[0] = $stryLocalBackupRetention[0];
+ }
+ }
- # Remove the entire directory if all archive is expired
- if ($bRemove)
+ # If no local backups were found as part of retention then set the backup archive retention to the newest backup
+ # so that the database is fully recoverable (can be recovered from the last backup through pitr)
+ if (!@stryLocalBackupArchiveRentention)
+ {
+ $stryLocalBackupArchiveRentention[0] = $stryLocalBackupRetention[-1];
+ }
+
+ my $strArchiveRetentionBackup = $stryLocalBackupArchiveRentention[0];
+
+ # If a backup has been selected for retention then continue
+ if (defined($strArchiveRetentionBackup))
+ {
+ my $bRemove;
+
+ # Only expire if the selected backup has archive info - backups performed with --no-online will
+ # not have archive info and cannot be used for expiration.
+ if ($oBackupInfo->test(INFO_BACKUP_SECTION_BACKUP_CURRENT,
+ $strArchiveRetentionBackup, INFO_BACKUP_KEY_ARCHIVE_START))
+ {
+ # Get archive ranges to preserve. Because archive retention can be less than total retention it is
+ # important to preserve archive that is required to make the older backups consistent even though they
+ # cannot be played any further forward with PITR.
+ my $strArchiveExpireMax;
+ my @oyArchiveRange;
+ my @stryBackupList = $oBackupInfo->list();
+
+ # With the full list of backups, loop through only those associated with this archiveId
+ foreach my $strBackup ($oBackupInfo->listByArchiveId($strArchiveId,
+ $oFile->pathGet(PATH_BACKUP_ARCHIVE), \@stryBackupList))
{
- my $strFullPath = $oFile->pathGet(PATH_BACKUP_ARCHIVE, $strArchiveId) . "/${strPath}";
-
- remove_tree($strFullPath) > 0
- or confess &log(ERROR, "unable to remove ${strFullPath}", ERROR_PATH_REMOVE);
-
- # Log expire info
- logDebugMisc($strOperation, "remove major WAL path: ${strFullPath}");
- $self->logExpire($strPath);
- }
- # Else delete individual files instead if the major path is less than or equal to the most recent retention
- # backup. This optimization prevents scanning though major paths that could not possibly have anything to
- # expire.
- elsif ($strPath le substr($strArchiveExpireMax, 0, 16))
- {
- # Look for files in the archive directory
- foreach my $strSubPath ($oFile->list(PATH_BACKUP_ARCHIVE,
- "${strArchiveId}/${strPath}", "^[0-F]{24}.*\$"))
+ if ($strBackup le $strArchiveRetentionBackup &&
+ $oBackupInfo->test(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_ARCHIVE_START))
{
- $bRemove = true;
+ my $oArchiveRange = {};
- # Determine if the individual archive log is used in a backup
- foreach my $oArchiveRange (@oyArchiveRange)
+ $$oArchiveRange{start} = $oBackupInfo->get(INFO_BACKUP_SECTION_BACKUP_CURRENT,
+ $strBackup, INFO_BACKUP_KEY_ARCHIVE_START);
+
+ if ($strBackup ne $strArchiveRetentionBackup)
{
- if (substr($strSubPath, 0, 24) ge $$oArchiveRange{start} &&
- (!defined($$oArchiveRange{stop}) || substr($strSubPath, 0, 24) le $$oArchiveRange{stop}))
- {
- $bRemove = false;
- last;
- }
- }
-
- # Remove archive log if it is not used in a backup
- if ($bRemove)
- {
- fileRemove($oFile->pathGet(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strSubPath}"));
-
- logDebugMisc($strOperation, "remove WAL segment: ${strSubPath}");
-
- # Log expire info
- $self->logExpire(substr($strSubPath, 0, 24));
+ $$oArchiveRange{stop} = $oBackupInfo->get(INFO_BACKUP_SECTION_BACKUP_CURRENT,
+ $strBackup, INFO_BACKUP_KEY_ARCHIVE_STOP);
}
else
{
- # Log that the file was not expired
- $self->logExpire();
+ $strArchiveExpireMax = $$oArchiveRange{start};
+ }
+
+ &log(DETAIL, "archive retention on backup ${strBackup}, archiveId = ${strArchiveId}, " .
+ "start = $$oArchiveRange{start}" .
+ (defined($$oArchiveRange{stop}) ? ", stop = $$oArchiveRange{stop}" : ''));
+
+ push(@oyArchiveRange, $oArchiveRange);
+ }
+ }
+
+ # Get all major archive paths (timeline and first 32 bits of LSN)
+ foreach my $strPath ($oFile->list(PATH_BACKUP_ARCHIVE, $strArchiveId, REGEX_ARCHIVE_DIR_WAL))
+ {
+ logDebugMisc($strOperation, "found major WAL path: ${strPath}");
+ $bRemove = true;
+
+ # Keep the path if it falls in the range of any backup in retention
+ foreach my $oArchiveRange (@oyArchiveRange)
+ {
+ if ($strPath ge substr($$oArchiveRange{start}, 0, 16) &&
+ (!defined($$oArchiveRange{stop}) || $strPath le substr($$oArchiveRange{stop}, 0, 16)))
+ {
+ $bRemove = false;
+ last;
+ }
+ }
+
+ # Remove the entire directory if all archive is expired
+ if ($bRemove)
+ {
+ my $strFullPath = $oFile->pathGet(PATH_BACKUP_ARCHIVE, $strArchiveId) . "/${strPath}";
+
+ remove_tree($strFullPath) > 0
+ or confess &log(ERROR, "unable to remove ${strFullPath}", ERROR_PATH_REMOVE);
+
+ # Log expire info
+ logDebugMisc($strOperation, "remove major WAL path: ${strFullPath}");
+ $self->logExpire($strPath);
+ }
+ # Else delete individual files instead if the major path is less than or equal to the most recent
+ # retention backup. This optimization prevents scanning though major paths that could not possibly
+ # have anything to expire.
+ elsif ($strPath le substr($strArchiveExpireMax, 0, 16))
+ {
+ # Look for files in the archive directory
+ foreach my $strSubPath ($oFile->list(PATH_BACKUP_ARCHIVE,
+ "${strArchiveId}/${strPath}", "^[0-F]{24}.*\$"))
+ {
+ $bRemove = true;
+
+ # Determine if the individual archive log is used in a backup
+ foreach my $oArchiveRange (@oyArchiveRange)
+ {
+ if (substr($strSubPath, 0, 24) ge $$oArchiveRange{start} &&
+ (!defined($$oArchiveRange{stop}) || substr($strSubPath, 0, 24) le $$oArchiveRange{stop}))
+ {
+ $bRemove = false;
+ last;
+ }
+ }
+
+ # Remove archive log if it is not used in a backup
+ if ($bRemove)
+ {
+ fileRemove($oFile->pathGet(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strSubPath}"));
+
+ logDebugMisc($strOperation, "remove WAL segment: ${strSubPath}");
+
+ # Log expire info
+ $self->logExpire(substr($strSubPath, 0, 24));
+ }
+ else
+ {
+ # Log that the file was not expired
+ $self->logExpire();
+ }
}
}
}
- }
- # Log if no archive was expired
- if ($self->{iArchiveExpireTotal} == 0)
- {
- &log(DETAIL, 'no archive to remove');
+ # Log if no archive was expired
+ if ($self->{iArchiveExpireTotal} == 0)
+ {
+ &log(DETAIL, 'no archive to remove');
+ }
}
}
}
diff --git a/lib/pgBackRest/Info.pm b/lib/pgBackRest/Info.pm
index f80497290..6d096c7ff 100644
--- a/lib/pgBackRest/Info.pm
+++ b/lib/pgBackRest/Info.pm
@@ -19,6 +19,7 @@ use pgBackRest::BackupInfo;
use pgBackRest::Config::Config;
use pgBackRest::File;
use pgBackRest::FileCommon;
+use pgBackRest::InfoCommon;
use pgBackRest::Manifest;
use pgBackRest::Protocol::Common;
use pgBackRest::Protocol::Protocol;
@@ -49,7 +50,7 @@ use constant INFO_STANZA_STATUS_NO_BACKUP_MESSAGE => 'no valid
use constant INFO_KEY_CODE => 'code';
use constant INFO_KEY_DELTA => 'delta';
use constant INFO_KEY_FORMAT => 'format';
-use constant INFO_KEY_ID => 'id';
+use constant INFO_KEY_ID => INFO_HISTORY_ID;
use constant INFO_KEY_LABEL => 'label';
use constant INFO_KEY_MAX => 'max';
use constant INFO_KEY_MIN => 'min';
@@ -59,9 +60,9 @@ use constant INFO_KEY_REFERENCE => 'referenc
use constant INFO_KEY_SIZE => 'size';
use constant INFO_KEY_START => 'start';
use constant INFO_KEY_STOP => 'stop';
-use constant INFO_KEY_SYSTEM_ID => 'system-id';
+use constant INFO_KEY_SYSTEM_ID => INFO_SYSTEM_ID;
use constant INFO_KEY_TYPE => 'type';
-use constant INFO_KEY_VERSION => 'version';
+use constant INFO_KEY_VERSION => INFO_DB_VERSION;
####################################################################################################################################
# CONSTRUCTOR
@@ -487,10 +488,10 @@ sub backupList
{
my $oDbHash =
{
- &INFO_KEY_ID => $iHistoryId,
- &INFO_KEY_VERSION =>
+ &INFO_HISTORY_ID => $iHistoryId,
+ &INFO_DB_VERSION =>
$oBackupInfo->get(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_DB_VERSION),
- &INFO_KEY_SYSTEM_ID =>
+ &INFO_SYSTEM_ID =>
$oBackupInfo->get(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_SYSTEM_ID)
};
diff --git a/lib/pgBackRest/InfoCommon.pm b/lib/pgBackRest/InfoCommon.pm
new file mode 100644
index 000000000..663dd5cb0
--- /dev/null
+++ b/lib/pgBackRest/InfoCommon.pm
@@ -0,0 +1,32 @@
+####################################################################################################################################
+# INFO MODULE
+# Constants, variables and functions common to the info files
+####################################################################################################################################
+package pgBackRest::InfoCommon;
+
+use strict;
+use warnings FATAL => qw(all);
+use Carp qw(confess);
+
+use Exporter qw(import);
+ our @EXPORT = qw();
+
+####################################################################################################################################
+# DB section constants
+####################################################################################################################################
+use constant INFO_BACKUP_SECTION_DB => 'db';
+ push @EXPORT, qw(INFO_BACKUP_SECTION_DB);
+use constant INFO_BACKUP_SECTION_DB_HISTORY => INFO_BACKUP_SECTION_DB . ':history';
+ push @EXPORT, qw(INFO_BACKUP_SECTION_DB_HISTORY);
+
+####################################################################################################################################
+# History section constants
+####################################################################################################################################
+use constant INFO_HISTORY_ID => 'id';
+ push @EXPORT, qw(INFO_HISTORY_ID);
+use constant INFO_DB_VERSION => 'version';
+ push @EXPORT, qw(INFO_DB_VERSION);
+use constant INFO_SYSTEM_ID => 'system-id';
+ push @EXPORT, qw(INFO_SYSTEM_ID);
+
+1;
diff --git a/lib/pgBackRest/Stanza.pm b/lib/pgBackRest/Stanza.pm
index 897a6fc6f..eff50688d 100644
--- a/lib/pgBackRest/Stanza.pm
+++ b/lib/pgBackRest/Stanza.pm
@@ -22,6 +22,7 @@ use pgBackRest::Db;
use pgBackRest::DbVersion;
use pgBackRest::File;
use pgBackRest::FileCommon;
+use pgBackRest::InfoCommon;
use pgBackRest::Protocol::Common;
use pgBackRest::Protocol::Protocol;
@@ -47,6 +48,7 @@ sub new
# Initialize the database object
$self->{oDb} = dbMasterGet();
+ $self->dbInfoGet();
# Return from function and log return values if any
return logDebugReturn
@@ -56,22 +58,6 @@ sub new
);
}
-####################################################################################################################################
-# DESTROY
-####################################################################################################################################
-sub DESTROY
-{
- my $self = shift;
-
- # Assign function parameters, defaults, and log debug info
- my ($strOperation) = logDebugParam(__PACKAGE__ . '->DESTROY');
-
- undef($self->{oDb});
-
- # Return from function and log return values if any
- return logDebugReturn($strOperation);
-}
-
####################################################################################################################################
# Process Stanza Commands
####################################################################################################################################
@@ -82,14 +68,23 @@ sub process
# Assign function parameters, defaults, and log debug info
my ($strOperation) = logDebugParam(__PACKAGE__ . '->process');
- # Error if any other command other than stanza-create is found
- if (!commandTest(CMD_STANZA_CREATE))
- {
- confess &log(ASSERT, "Stanza->process() called with invalid command: " . commandGet());
- }
+ my $iResult = 0;
# Process stanza create
- my $iResult = $self->stanzaCreate();
+ if (commandTest(CMD_STANZA_CREATE))
+ {
+ $iResult = $self->stanzaCreate();
+ }
+ # Process stanza upgrade
+ elsif (commandTest(CMD_STANZA_UPGRADE))
+ {
+ $iResult = $self->stanzaUpgrade();
+ }
+ # Else error if any other command is found
+ else
+ {
+ confess &log(ASSERT, "stanza->process() called with invalid command: " . commandGet());
+ }
# Return from function and log return values if any
return logDebugReturn
@@ -119,8 +114,6 @@ sub stanzaCreate
protocolGet(NONE)
);
- $self->dbInfoGet();
-
# Get the parent paths (create if not exist)
my $strParentPathArchive = $self->parentPathGet($oFile, PATH_BACKUP_ARCHIVE);
my $strParentPathBackup = $self->parentPathGet($oFile, PATH_BACKUP_CLUSTER);
@@ -174,6 +167,76 @@ sub stanzaCreate
);
}
+####################################################################################################################################
+# stanzaUpgrade
+#
+# Updates stanza information to reflect new cluster information. Normally used for version upgrades, but could be used after a
+# cluster has been dumped and restored to the same version.
+####################################################################################################################################
+sub stanzaUpgrade
+{
+ my $self = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my ($strOperation) = logDebugParam(__PACKAGE__ . '->stanzaUpgrade');
+
+ # Initialize default file object with protocol set to NONE meaning strictly local
+ my $oFile = new pgBackRest::File
+ (
+ optionGet(OPTION_STANZA),
+ optionGet(OPTION_REPO_PATH),
+ protocolGet(NONE)
+ );
+
+ # Get the archive info and backup info files; if either does not exist an error will be thrown
+ my $oArchiveInfo = new pgBackRest::Archive::ArchiveInfo($oFile->pathGet(PATH_BACKUP_ARCHIVE));
+ my $oBackupInfo = new pgBackRest::BackupInfo($oFile->pathGet(PATH_BACKUP_CLUSTER));
+ my $bBackupUpgraded = false;
+ my $bArchiveUpgraded = false;
+
+ # If the DB section does not match, then upgrade
+ if ($self->upgradeCheck($oBackupInfo, PATH_BACKUP_CLUSTER, ERROR_BACKUP_MISMATCH))
+ {
+ # Determine if it is necessary to reconstruct the file
+ my ($bReconstruct, $strWarningMsgArchive) =
+ $self->reconstructCheck($oBackupInfo, PATH_BACKUP_CLUSTER, $oFile, $oFile->pathGet(PATH_BACKUP_CLUSTER));
+
+ # If reconstruction was required then save the reconstructed file
+ if ($bReconstruct)
+ {
+ $oBackupInfo->save();
+ $bBackupUpgraded = true;
+ }
+ }
+
+ if ($self->upgradeCheck($oArchiveInfo, PATH_BACKUP_ARCHIVE, ERROR_ARCHIVE_MISMATCH))
+ {
+ # Determine if it is necessary to reconstruct the file
+ my ($bReconstruct, $strWarningMsgArchive) =
+ $self->reconstructCheck($oArchiveInfo, PATH_BACKUP_ARCHIVE, $oFile, $oFile->pathGet(PATH_BACKUP_ARCHIVE));
+
+ # If reconstruction was required then save the reconstructed file
+ if ($bReconstruct)
+ {
+ $oArchiveInfo->save();
+ $bArchiveUpgraded = true;
+ }
+ }
+
+ # If neither file needed upgrading then provide informational message that an upgrade was not necessary
+ if (!($bBackupUpgraded || $bArchiveUpgraded))
+ {
+ &log(INFO, "the stanza data is already up to date");
+ }
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'iResult', value => 0, trace => true}
+ );
+}
+
####################################################################################################################################
# parentPathGet
#
@@ -246,84 +309,40 @@ sub infoFileCreate
my $iResult = 0;
my $strResultMessage = undef;
my $strWarningMsgArchive = undef;
- my $bSave = true;
+ my $bReconstruct = true;
+
+
+ # If force was not used and the info file does not exist and the directory is not empty, then error
+ # This should also be performed by the calling routine before this function is called, so this is just a safety check
+ if (!optionGet(OPTION_FORCE) && !$oInfo->{bExists} && @$stryFileList)
+ {
+ confess &log(ERROR, ($strPathType eq PATH_BACKUP_CLUSTER ? 'backup directory ' : 'archive directory ') .
+ $strStanzaCreateErrorMsg, ERROR_PATH_NOT_EMPTY);
+ }
# Turn off console logging to control when to display the error
- logLevelSet(undef, OFF);
+ logDisable();
eval
{
- # ??? File init will need to be addressed with stanza-upgrade since there could then be more than one DB and db-id
- # so the DB section, esp for backup.info, cannot be initialized before we attempt to reconstruct the file from the
- # directories since the history id would be wrong. Also need to handle if the reconstruction fails - if any file in
- # the backup directory or archive directory are missing or mal-formed, then currently an error will be thrown, which
- # may not be desireable.
+ ($bReconstruct, $strWarningMsgArchive) = $self->reconstructCheck($oInfo, $strPathType, $oFile, $strParentPath);
- # If the info file does not exist, initialize it internally but do not save until complete reconstruction
- if (!$oInfo->{bExists})
+ if ($oInfo->{bExists} && $bReconstruct)
{
- ($strPathType eq PATH_BACKUP_CLUSTER)
- ? $oInfo->create($self->{oDb}{strDbVersion}, $self->{oDb}{ullDbSysId}, $self->{oDb}{iControlVersion},
- $self->{oDb}{iCatalogVersion}, false)
- : $oInfo->create($self->{oDb}{strDbVersion}, $self->{oDb}{ullDbSysId}, false);
- }
-
- # Reconstruct the file from the data in the directory if there is any
- if ($strPathType eq PATH_BACKUP_CLUSTER)
- {
- $oInfo->reconstruct(false, false);
- }
- # If this is the archive.info reconstruction then catch any warnings
- else
- {
- $strWarningMsgArchive = $oInfo->reconstruct($oFile, $self->{oDb}{strDbVersion}, $self->{oDb}{ullDbSysId});
- }
-
- # If the file exists on disk, then check if the reconstructed data is the same as what is on disk
- if ($oInfo->{bExists})
- {
- my $oInfoOnDisk =
- ($strPathType eq PATH_BACKUP_CLUSTER ? new pgBackRest::BackupInfo($strParentPath)
- : new pgBackRest::Archive::ArchiveInfo($strParentPath));
-
# If force was not used and the hashes are different then error
- if ($oInfoOnDisk->hash() ne $oInfo->hash())
+ if (!optionGet(OPTION_FORCE))
{
- if (!optionGet(OPTION_FORCE))
- {
- $iResult = ERROR_FILE_INVALID;
- $strResultMessage =
- ($strPathType eq PATH_BACKUP_CLUSTER ? 'backup file ' : 'archive file ') .
- ' invalid; to correct, use --force';
- }
+ $iResult = ERROR_FILE_INVALID;
+ $strResultMessage =
+ ($strPathType eq PATH_BACKUP_CLUSTER ? 'backup file ' : 'archive file ') . "invalid\n" .
+ 'HINT: use stanza-upgrade if the database has been upgraded or use --force';
}
- # If the hashes are the same, then don't save the file since it already exists and is valid
- else
- {
- $bSave = false;
- }
- }
-
- # If force was not used and the info file does not exist and the directory is not empty, then error
- # This should also be performed by the calling routine before this function is called, so this is just a safety check
- if ($iResult == 0 && !optionGet(OPTION_FORCE) && !$oInfo->{bExists} && @$stryFileList)
- {
- $iResult = ERROR_PATH_NOT_EMPTY;
- $strResultMessage =
- ($strPathType eq PATH_BACKUP_CLUSTER ? 'backup directory ' : 'archive directory ') . $strStanzaCreateErrorMsg;
}
if ($iResult == 0)
{
- # ??? With stanza-upgrade we will want ability to force the DB section to match but for now, if it doesn't match,
- # then something is wrong.
- ($strPathType eq PATH_BACKUP_CLUSTER)
- ? $oInfo->check($self->{oDb}{strDbVersion}, $self->{oDb}{iControlVersion}, $self->{oDb}{iCatalogVersion},
- $self->{oDb}{ullDbSysId}, false)
- : $oInfo->check($self->{oDb}{strDbVersion}, $self->{oDb}{ullDbSysId}, false);
-
# Save the reconstructed file
- if ($bSave)
+ if ($bReconstruct)
{
$oInfo->save();
}
@@ -337,18 +356,18 @@ sub infoFileCreate
}
}
+ # Reset the console logging
+ logEnable();
return true;
}
or do
{
- # Capture error information
+ # Reset console logging and capture error information
+ logEnable();
$iResult = exceptionCode($EVAL_ERROR);
$strResultMessage = exceptionMessage($EVAL_ERROR->message());
};
- # Reset the console logging
- logLevelSet(undef, optionGet(OPTION_LOG_LEVEL_CONSOLE));
-
# If a warning was issued, raise it
if (defined($strWarningMsgArchive))
{
@@ -392,4 +411,131 @@ sub dbInfoGet
return logDebugReturn($strOperation);
}
+####################################################################################################################################
+# reconstructCheck
+#
+# Reconstruct the file based on disk data. If the info file already exists, it compares the reconstructed file to the existing file
+# and indicates if reconstruction is required. If the file does not yet exist on disk, it will still indicate reconstruction is
+# needed. The oInfo object contains the reconstructed data and can be saved by the calling routine.
+####################################################################################################################################
+sub reconstructCheck
+{
+ my $self = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oInfo,
+ $strPathType,
+ $oFile,
+ $strParentPath,
+ ) =
+ logDebugParam
+ (
+ __PACKAGE__ . '->reconstructCheck', \@_,
+ {name => 'oInfo'},
+ {name => 'strPathType'},
+ {name => 'oFile'},
+ {name => 'strParentPath'},
+ );
+
+ my $bReconstruct = true;
+ my $strWarningMsgArchive = undef;
+
+ # Reconstruct the file from the data in the directory if there is any else initialize the file
+ if ($strPathType eq PATH_BACKUP_CLUSTER)
+ {
+ $oInfo->reconstruct(false, false, $self->{oDb}{strDbVersion}, $self->{oDb}{ullDbSysId}, $self->{oDb}{iControlVersion},
+ $self->{oDb}{iCatalogVersion});
+ }
+ # If this is the archive.info reconstruction then catch any warnings
+ else
+ {
+ $strWarningMsgArchive = $oInfo->reconstruct($oFile, $self->{oDb}{strDbVersion}, $self->{oDb}{ullDbSysId});
+ }
+
+ # If the file exists on disk, then check if the reconstructed data is the same as what is on disk
+ if ($oInfo->{bExists})
+ {
+ my $oInfoOnDisk =
+ ($strPathType eq PATH_BACKUP_CLUSTER ? new pgBackRest::BackupInfo($strParentPath)
+ : new pgBackRest::Archive::ArchiveInfo($strParentPath));
+
+ # If the hashes are the same, then no need to reconstruct the file since it already exists and is valid
+ if ($oInfoOnDisk->hash() eq $oInfo->hash())
+ {
+ $bReconstruct = false;
+ }
+ }
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'bReconstruct', value => $bReconstruct},
+ {name => 'strWarningMsgArchive', value => $strWarningMsgArchive},
+ );
+}
+
+####################################################################################################################################
+# upgradeCheck
+#
+# Checks the info file to see if an upgrade is necessary.
+####################################################################################################################################
+sub upgradeCheck
+{
+ my $self = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oInfo,
+ $strPathType,
+ $iExpectedError,
+ ) =
+ logDebugParam
+ (
+ __PACKAGE__ . '->upgradeCheck', \@_,
+ {name => 'oInfo'},
+ {name => 'strPathType'},
+ {name => 'iExpectedError'},
+ );
+
+ my $iResult = 0;
+ my $strResultMessage = undef;
+
+ # Turn off console logging to control when to display the error
+ logDisable();
+
+ eval
+ {
+ ($strPathType eq PATH_BACKUP_CLUSTER)
+ ? $oInfo->check($self->{oDb}{strDbVersion}, $self->{oDb}{iControlVersion}, $self->{oDb}{iCatalogVersion},
+ $self->{oDb}{ullDbSysId}, true)
+ : $oInfo->check($self->{oDb}{strDbVersion}, $self->{oDb}{ullDbSysId}, true);
+ logEnable();
+ return true;
+ }
+ or do
+ {
+ logEnable();
+
+ # Confess unhandled errors
+ confess $EVAL_ERROR if (exceptionCode($EVAL_ERROR) != $iExpectedError);
+
+ # Capture the result which will be the expected error, meaning an upgrade is needed
+ $iResult = exceptionCode($EVAL_ERROR);
+ $strResultMessage = exceptionMessage($EVAL_ERROR->message());
+ };
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'bResult', value => ($iResult == $iExpectedError ? true : false)},
+ );
+}
+
1;
diff --git a/test/data/backup.pg_control_92.bin b/test/data/backup.pg_control_92.bin
new file mode 100644
index 000000000..baf34f45c
Binary files /dev/null and b/test/data/backup.pg_control_92.bin differ
diff --git a/test/data/backup.pg_control_93.bin b/test/data/backup.pg_control_93.bin
index 66eda35d0..176545bdd 100644
Binary files a/test/data/backup.pg_control_93.bin and b/test/data/backup.pg_control_93.bin differ
diff --git a/test/data/backup.pg_control_95.bin b/test/data/backup.pg_control_95.bin
new file mode 100644
index 000000000..7167156d0
Binary files /dev/null and b/test/data/backup.pg_control_95.bin differ
diff --git a/test/data/backup.wal1_92.bin b/test/data/backup.wal1_92.bin
new file mode 100644
index 000000000..ebe639af4
Binary files /dev/null and b/test/data/backup.wal1_92.bin differ
diff --git a/test/data/backup.wal1_93.bin b/test/data/backup.wal1_93.bin
new file mode 100644
index 000000000..3a322900c
Binary files /dev/null and b/test/data/backup.wal1_93.bin differ
diff --git a/test/data/backup.wal1_95.bin b/test/data/backup.wal1_95.bin
new file mode 100644
index 000000000..349b674f6
Binary files /dev/null and b/test/data/backup.wal1_95.bin differ
diff --git a/test/expect/expire-expire-001.log b/test/expect/expire-expire-001.log
index 0aa3c43a4..e90ae3831 100644
--- a/test/expect/expire-expire-001.log
+++ b/test/expect/expire-expire-001.log
@@ -17,14 +17,14 @@ backrest-version="[VERSION-1]"
[BACKUP-INCR-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"0000000100000000000000FB","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-1]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -300,7 +300,7 @@ Nothing to expire
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config="[TEST_PATH]/db-master/pgbackrest.conf" --stanza=db --log-level-console=detail --retention-full=1 --retention-diff=1 --retention-archive-type=full --retention-archive=1 expire
------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-master/pgbackrest.conf --lock-path=[TEST_PATH]/db-master/repo/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/repo/log --repo-path=[TEST_PATH]/db-master/repo --retention-archive=1 --retention-archive-type=full --retention-diff=1 --retention-full=1 --stanza=db
-P00 DETAIL: archive retention on backup [BACKUP-FULL-1], start = 000000010000000000000000
+P00 DETAIL: archive retention on backup [BACKUP-FULL-1], archiveId = 9.2-1, start = 000000010000000000000000
P00 DETAIL: no archive to remove
P00 INFO: expire command end: completed successfully
@@ -316,14 +316,14 @@ backrest-version="[VERSION-1]"
[BACKUP-INCR-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"0000000100000000000000FB","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-1]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -611,14 +611,14 @@ backrest-version="[VERSION-1]"
[BACKUP-FULL-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000100000000","backup-archive-stop":"000000010000000100000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -907,7 +907,7 @@ P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-mas
P00 INFO: expire full backup set: [BACKUP-FULL-1], [BACKUP-INCR-1]
P00 INFO: remove expired backup [BACKUP-INCR-1]
P00 INFO: remove expired backup [BACKUP-FULL-1]
-P00 DETAIL: archive retention on backup [BACKUP-FULL-2], start = 000000010000000100000000
+P00 DETAIL: archive retention on backup [BACKUP-FULL-2], archiveId = 9.2-1, start = 000000010000000100000000
P00 DETAIL: remove archive: start = 0000000100000000, stop = 0000000100000000
P00 INFO: expire command end: completed successfully
@@ -922,14 +922,14 @@ backrest-version="[VERSION-1]"
[BACKUP-FULL-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000100000000","backup-archive-stop":"000000010000000100000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -968,14 +968,14 @@ backrest-version="[VERSION-1]"
[BACKUP-DIFF-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000010000000C","backup-archive-stop":"00000001000000020000000C","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-1]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -1273,7 +1273,7 @@ Expire oldest full backup
P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-master/pgbackrest.conf --lock-path=[TEST_PATH]/db-master/repo/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/repo/log --repo-path=[TEST_PATH]/db-master/repo --retention-archive=1 --retention-archive-type=full --retention-diff=1 --retention-full=1 --stanza=db
P00 INFO: expire diff backup [BACKUP-DIFF-1]
P00 INFO: remove expired backup [BACKUP-DIFF-1]
-P00 DETAIL: archive retention on backup [BACKUP-FULL-2], start = 000000010000000100000000
+P00 DETAIL: archive retention on backup [BACKUP-FULL-2], archiveId = 9.2-1, start = 000000010000000100000000
P00 DETAIL: no archive to remove
P00 INFO: expire command end: completed successfully
@@ -1289,14 +1289,14 @@ backrest-version="[VERSION-1]"
[BACKUP-DIFF-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000010000000C","backup-archive-stop":"00000001000000020000000C","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-1]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -1607,14 +1607,14 @@ backrest-version="[VERSION-1]"
[BACKUP-INCR-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000001A","backup-archive-stop":"00000001000000020000001C","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-3]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -1929,8 +1929,8 @@ P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-mas
P00 INFO: expire full backup set: [BACKUP-FULL-2], [BACKUP-DIFF-2]
P00 INFO: remove expired backup [BACKUP-DIFF-2]
P00 INFO: remove expired backup [BACKUP-FULL-2]
-P00 DETAIL: archive retention on backup [BACKUP-FULL-3], start = 000000010000000200000010, stop = 000000010000000200000012
-P00 DETAIL: archive retention on backup [BACKUP-DIFF-3], start = 000000010000000200000016
+P00 DETAIL: archive retention on backup [BACKUP-FULL-3], archiveId = 9.2-1, start = 000000010000000200000010, stop = 000000010000000200000012
+P00 DETAIL: archive retention on backup [BACKUP-DIFF-3], archiveId = 9.2-1, start = 000000010000000200000016
P00 DETAIL: remove archive: start = 0000000100000001, stop = 00000001000000020000000F
P00 DETAIL: remove archive: start = 000000010000000200000013, stop = 000000010000000200000015
P00 INFO: expire command end: completed successfully
@@ -1948,14 +1948,14 @@ backrest-version="[VERSION-1]"
[BACKUP-INCR-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000001A","backup-archive-stop":"00000001000000020000001C","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-3]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2001,14 +2001,14 @@ backrest-version="[VERSION-1]"
[BACKUP-DIFF-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000001E","backup-archive-stop":"000000010000000200000020","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-INCR-2]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2051,8 +2051,8 @@ P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-mas
P00 INFO: expire diff backup set: [BACKUP-DIFF-3], [BACKUP-INCR-2]
P00 INFO: remove expired backup [BACKUP-INCR-2]
P00 INFO: remove expired backup [BACKUP-DIFF-3]
-P00 DETAIL: archive retention on backup [BACKUP-FULL-3], start = 000000010000000200000010, stop = 000000010000000200000012
-P00 DETAIL: archive retention on backup [BACKUP-DIFF-4], start = 00000001000000020000001E
+P00 DETAIL: archive retention on backup [BACKUP-FULL-3], archiveId = 9.2-1, start = 000000010000000200000010, stop = 000000010000000200000012
+P00 DETAIL: archive retention on backup [BACKUP-DIFF-4], archiveId = 9.2-1, start = 00000001000000020000001E
P00 DETAIL: remove archive: start = 000000010000000200000016, stop = 00000001000000020000001D
P00 INFO: expire command end: completed successfully
@@ -2068,14 +2068,14 @@ backrest-version="[VERSION-1]"
[BACKUP-DIFF-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000001E","backup-archive-stop":"000000010000000200000020","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-INCR-2]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2117,14 +2117,14 @@ backrest-version="[VERSION-1]"
[BACKUP-INCR-3]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000024","backup-archive-stop":"000000010000000200000026","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-4]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2161,9 +2161,9 @@ Expire archive based on newest incr backup
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config="[TEST_PATH]/db-master/pgbackrest.conf" --stanza=db --log-level-console=detail --retention-full=1 --retention-diff=1 --retention-archive-type=incr --retention-archive=1 expire
------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-master/pgbackrest.conf --lock-path=[TEST_PATH]/db-master/repo/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/repo/log --repo-path=[TEST_PATH]/db-master/repo --retention-archive=1 --retention-archive-type=incr --retention-diff=1 --retention-full=1 --stanza=db
-P00 DETAIL: archive retention on backup [BACKUP-FULL-3], start = 000000010000000200000010, stop = 000000010000000200000012
-P00 DETAIL: archive retention on backup [BACKUP-DIFF-4], start = 00000001000000020000001E, stop = 000000010000000200000020
-P00 DETAIL: archive retention on backup [BACKUP-INCR-3], start = 000000010000000200000024
+P00 DETAIL: archive retention on backup [BACKUP-FULL-3], archiveId = 9.2-1, start = 000000010000000200000010, stop = 000000010000000200000012
+P00 DETAIL: archive retention on backup [BACKUP-DIFF-4], archiveId = 9.2-1, start = 00000001000000020000001E, stop = 000000010000000200000020
+P00 DETAIL: archive retention on backup [BACKUP-INCR-3], archiveId = 9.2-1, start = 000000010000000200000024
P00 DETAIL: remove archive: start = 000000010000000200000021, stop = 000000010000000200000023
P00 INFO: expire command end: completed successfully
@@ -2180,14 +2180,14 @@ backrest-version="[VERSION-1]"
[BACKUP-INCR-3]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000024","backup-archive-stop":"000000010000000200000026","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-4]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2238,14 +2238,14 @@ backrest-version="[VERSION-1]"
[BACKUP-FULL-5]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000036","backup-archive-stop":"000000010000000200000038","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2306,8 +2306,8 @@ P00 INFO: remove expired backup [BACKUP-DIFF-5]
P00 INFO: remove expired backup [BACKUP-INCR-3]
P00 INFO: remove expired backup [BACKUP-DIFF-4]
P00 INFO: remove expired backup [BACKUP-FULL-3]
-P00 DETAIL: archive retention on backup [BACKUP-FULL-4], start = 00000001000000020000002A, stop = 00000001000000020000002C
-P00 DETAIL: archive retention on backup [BACKUP-FULL-5], start = 000000010000000200000036
+P00 DETAIL: archive retention on backup [BACKUP-FULL-4], archiveId = 9.2-1, start = 00000001000000020000002A, stop = 00000001000000020000002C
+P00 DETAIL: archive retention on backup [BACKUP-FULL-5], archiveId = 9.2-1, start = 000000010000000200000036
P00 DETAIL: remove archive: start = 000000010000000200000010, stop = 000000010000000200000029
P00 DETAIL: remove archive: start = 00000001000000020000002D, stop = 000000010000000200000035
P00 INFO: expire command end: completed successfully
@@ -2324,14 +2324,14 @@ backrest-version="[VERSION-1]"
[BACKUP-FULL-5]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000036","backup-archive-stop":"000000010000000200000038","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2377,14 +2377,14 @@ backrest-version="[VERSION-1]"
[BACKUP-DIFF-7]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000048","backup-archive-stop":"00000001000000020000004A","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-6]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2439,11 +2439,11 @@ P00 WARN: option retention-full is not set, the repository may run out of spac
HINT: to retain full backups indefinitely (without warning), set option 'retention-full' to the maximum.
P00 WARN: option 'retention-diff' is not set for 'retention-archive-type=diff'
HINT: to retain differential backups indefinitely (without warning), set option 'retention-diff' to the maximum.
-P00 DETAIL: archive retention on backup [BACKUP-FULL-4], start = 00000001000000020000002A, stop = 00000001000000020000002C
-P00 DETAIL: archive retention on backup [BACKUP-FULL-5], start = 000000010000000200000036, stop = 000000010000000200000038
-P00 DETAIL: archive retention on backup [BACKUP-FULL-6], start = 00000001000000020000003C, stop = 00000001000000020000003E
-P00 DETAIL: archive retention on backup [BACKUP-DIFF-6], start = 000000010000000200000042, stop = 000000010000000200000044
-P00 DETAIL: archive retention on backup [BACKUP-DIFF-7], start = 000000010000000200000048
+P00 DETAIL: archive retention on backup [BACKUP-FULL-4], archiveId = 9.2-1, start = 00000001000000020000002A, stop = 00000001000000020000002C
+P00 DETAIL: archive retention on backup [BACKUP-FULL-5], archiveId = 9.2-1, start = 000000010000000200000036, stop = 000000010000000200000038
+P00 DETAIL: archive retention on backup [BACKUP-FULL-6], archiveId = 9.2-1, start = 00000001000000020000003C, stop = 00000001000000020000003E
+P00 DETAIL: archive retention on backup [BACKUP-DIFF-6], archiveId = 9.2-1, start = 000000010000000200000042, stop = 000000010000000200000044
+P00 DETAIL: archive retention on backup [BACKUP-DIFF-7], archiveId = 9.2-1, start = 000000010000000200000048
P00 DETAIL: remove archive: start = 000000010000000200000039, stop = 00000001000000020000003B
P00 DETAIL: remove archive: start = 00000001000000020000003F, stop = 000000010000000200000041
P00 DETAIL: remove archive: start = 000000010000000200000045, stop = 000000010000000200000047
@@ -2464,14 +2464,14 @@ backrest-version="[VERSION-1]"
[BACKUP-DIFF-7]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000048","backup-archive-stop":"00000001000000020000004A","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-6]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2530,14 +2530,14 @@ backrest-version="[VERSION-1]"
[BACKUP-FULL-8]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000054","backup-archive-stop":"000000010000000200000056","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2595,13 +2595,13 @@ Expire full with retention-archive with warning retention-full not set
P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-master/pgbackrest.conf --lock-path=[TEST_PATH]/db-master/repo/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/repo/log --repo-path=[TEST_PATH]/db-master/repo --retention-archive=1 --retention-archive-type=full --stanza=db
P00 WARN: option retention-full is not set, the repository may run out of space
HINT: to retain full backups indefinitely (without warning), set option 'retention-full' to the maximum.
-P00 DETAIL: archive retention on backup [BACKUP-FULL-4], start = 00000001000000020000002A, stop = 00000001000000020000002C
-P00 DETAIL: archive retention on backup [BACKUP-FULL-5], start = 000000010000000200000036, stop = 000000010000000200000038
-P00 DETAIL: archive retention on backup [BACKUP-FULL-6], start = 00000001000000020000003C, stop = 00000001000000020000003E
-P00 DETAIL: archive retention on backup [BACKUP-DIFF-6], start = 000000010000000200000042, stop = 000000010000000200000044
-P00 DETAIL: archive retention on backup [BACKUP-DIFF-7], start = 000000010000000200000048, stop = 00000001000000020000004A
-P00 DETAIL: archive retention on backup [BACKUP-FULL-7], start = 00000001000000020000004E, stop = 000000010000000200000050
-P00 DETAIL: archive retention on backup [BACKUP-FULL-8], start = 000000010000000200000054
+P00 DETAIL: archive retention on backup [BACKUP-FULL-4], archiveId = 9.2-1, start = 00000001000000020000002A, stop = 00000001000000020000002C
+P00 DETAIL: archive retention on backup [BACKUP-FULL-5], archiveId = 9.2-1, start = 000000010000000200000036, stop = 000000010000000200000038
+P00 DETAIL: archive retention on backup [BACKUP-FULL-6], archiveId = 9.2-1, start = 00000001000000020000003C, stop = 00000001000000020000003E
+P00 DETAIL: archive retention on backup [BACKUP-DIFF-6], archiveId = 9.2-1, start = 000000010000000200000042, stop = 000000010000000200000044
+P00 DETAIL: archive retention on backup [BACKUP-DIFF-7], archiveId = 9.2-1, start = 000000010000000200000048, stop = 00000001000000020000004A
+P00 DETAIL: archive retention on backup [BACKUP-FULL-7], archiveId = 9.2-1, start = 00000001000000020000004E, stop = 000000010000000200000050
+P00 DETAIL: archive retention on backup [BACKUP-FULL-8], archiveId = 9.2-1, start = 000000010000000200000054
P00 DETAIL: remove archive: start = 00000001000000020000004B, stop = 00000001000000020000004D
P00 DETAIL: remove archive: start = 000000010000000200000051, stop = 000000010000000200000053
P00 INFO: expire command end: completed successfully
@@ -2623,14 +2623,14 @@ backrest-version="[VERSION-1]"
[BACKUP-FULL-8]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000054","backup-archive-stop":"000000010000000200000056","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2697,14 +2697,14 @@ backrest-version="[VERSION-1]"
[BACKUP-INCR-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000005A","backup-archive-stop":"00000001000000020000005C","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-8]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2787,14 +2787,14 @@ backrest-version="[VERSION-1]"
[BACKUP-INCR-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000005A","backup-archive-stop":"00000001000000020000005C","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-8]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2861,14 +2861,14 @@ backrest-version="[VERSION-1]"
[BACKUP-DIFF-9]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000006C","backup-archive-stop":"00000001000000020000006E","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-8]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -2961,14 +2961,14 @@ backrest-version="[VERSION-1]"
[BACKUP-DIFF-9]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000006C","backup-archive-stop":"00000001000000020000006E","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-8]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
[db]
-db-catalog-version=20920101
-db-control-version=921
+db-catalog-version=201204301
+db-control-version=922
db-id=1
-db-system-id=920000000000000001
+db-system-id=6393320793115174899
db-version="9.2"
[db:history]
-1={"db-catalog-version":20920101,"db-control-version":921,"db-system-id":920000000000000001,"db-version":"9.2"}
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------
@@ -3035,3 +3035,174 @@ db-version="9.2"
00000001000000020000006F-0000000000000000000000000000000000000000.gz
000000010000000200000070-0000000000000000000000000000000000000000
000000010000000200000071-0000000000000000000000000000000000000000.gz
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-8]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000054","backup-archive-stop":"000000010000000200000056","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-INCR-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000005A","backup-archive-stop":"00000001000000020000005C","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-8]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-9]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000060","backup-archive-stop":"000000010000000200000062","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-DIFF-8]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000066","backup-archive-stop":"000000010000000200000068","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-9]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-DIFF-9]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000006C","backup-archive-stop":"00000001000000020000006E","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-8]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201204301
+db-control-version=922
+db-id=1
+db-system-id=6393320793115174899
+db-version="9.2"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-8]
+[BACKUP-INCR-4]
+[BACKUP-FULL-9]
+[BACKUP-DIFF-8]
+[BACKUP-DIFF-9]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.2-1
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1:
+0000000100000002
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1/0000000100000002:
+00000001000000020000002A-0000000000000000000000000000000000000000.gz
+00000001000000020000002B-0000000000000000000000000000000000000000
+00000001000000020000002C-0000000000000000000000000000000000000000.gz
+000000010000000200000036-0000000000000000000000000000000000000000.gz
+000000010000000200000037-0000000000000000000000000000000000000000
+000000010000000200000038-0000000000000000000000000000000000000000.gz
+00000001000000020000003C-0000000000000000000000000000000000000000.gz
+00000001000000020000003D-0000000000000000000000000000000000000000
+00000001000000020000003E-0000000000000000000000000000000000000000.gz
+000000010000000200000042-0000000000000000000000000000000000000000.gz
+000000010000000200000043-0000000000000000000000000000000000000000
+000000010000000200000044-0000000000000000000000000000000000000000.gz
+000000010000000200000048-0000000000000000000000000000000000000000.gz
+000000010000000200000049-0000000000000000000000000000000000000000
+00000001000000020000004A-0000000000000000000000000000000000000000.gz
+00000001000000020000004E-0000000000000000000000000000000000000000.gz
+00000001000000020000004F-0000000000000000000000000000000000000000
+000000010000000200000050-0000000000000000000000000000000000000000.gz
+000000010000000200000054-0000000000000000000000000000000000000000.gz
+000000010000000200000055-0000000000000000000000000000000000000000
+000000010000000200000056-0000000000000000000000000000000000000000.gz
+000000010000000200000057-0000000000000000000000000000000000000000.gz
+000000010000000200000058-0000000000000000000000000000000000000000
+000000010000000200000059-0000000000000000000000000000000000000000.gz
+00000001000000020000005A-0000000000000000000000000000000000000000.gz
+00000001000000020000005B-0000000000000000000000000000000000000000
+00000001000000020000005C-0000000000000000000000000000000000000000.gz
+00000001000000020000005D-0000000000000000000000000000000000000000.gz
+00000001000000020000005E-0000000000000000000000000000000000000000
+00000001000000020000005F-0000000000000000000000000000000000000000.gz
+000000010000000200000060-0000000000000000000000000000000000000000.gz
+000000010000000200000061-0000000000000000000000000000000000000000
+000000010000000200000062-0000000000000000000000000000000000000000.gz
+000000010000000200000063-0000000000000000000000000000000000000000.gz
+000000010000000200000064-0000000000000000000000000000000000000000
+000000010000000200000065-0000000000000000000000000000000000000000.gz
+000000010000000200000066-0000000000000000000000000000000000000000.gz
+000000010000000200000067-0000000000000000000000000000000000000000
+000000010000000200000068-0000000000000000000000000000000000000000.gz
+000000010000000200000069-0000000000000000000000000000000000000000.gz
+00000001000000020000006A-0000000000000000000000000000000000000000
+00000001000000020000006B-0000000000000000000000000000000000000000.gz
+00000001000000020000006C-0000000000000000000000000000000000000000.gz
+00000001000000020000006D-0000000000000000000000000000000000000000
+00000001000000020000006E-0000000000000000000000000000000000000000.gz
+00000001000000020000006F-0000000000000000000000000000000000000000.gz
+000000010000000200000070-0000000000000000000000000000000000000000
+000000010000000200000071-0000000000000000000000000000000000000000.gz
+
+Use oldest full backup for archive retention
+> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config="[TEST_PATH]/db-master/pgbackrest.conf" --stanza=db --log-level-console=detail --retention-full=10 --retention-diff=10 --retention-archive-type=full --retention-archive=10 expire
+------------------------------------------------------------------------------------------------------------------------------------
+P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-master/pgbackrest.conf --lock-path=[TEST_PATH]/db-master/repo/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/repo/log --repo-path=[TEST_PATH]/db-master/repo --retention-archive=10 --retention-archive-type=full --retention-diff=10 --retention-full=10 --stanza=db
+P00 INFO: full backup total < 10 - using oldest full backup for 9.2-1 archive retention
+P00 DETAIL: archive retention on backup [BACKUP-FULL-8], archiveId = 9.2-1, start = 000000010000000200000054
+P00 DETAIL: remove archive: start = 00000001000000020000002A, stop = 000000010000000200000050
+P00 INFO: expire command end: completed successfully
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-8]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000054","backup-archive-stop":"000000010000000200000056","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-INCR-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000005A","backup-archive-stop":"00000001000000020000005C","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-8]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-9]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000060","backup-archive-stop":"000000010000000200000062","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-DIFF-8]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000200000066","backup-archive-stop":"000000010000000200000068","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-9]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-DIFF-9]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000020000006C","backup-archive-stop":"00000001000000020000006E","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-DIFF-8]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201204301
+db-control-version=922
+db-id=1
+db-system-id=6393320793115174899
+db-version="9.2"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-8]
+[BACKUP-INCR-4]
+[BACKUP-FULL-9]
+[BACKUP-DIFF-8]
+[BACKUP-DIFF-9]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.2-1
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1:
+0000000100000002
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1/0000000100000002:
+000000010000000200000054-0000000000000000000000000000000000000000.gz
+000000010000000200000055-0000000000000000000000000000000000000000
+000000010000000200000056-0000000000000000000000000000000000000000.gz
+000000010000000200000057-0000000000000000000000000000000000000000.gz
+000000010000000200000058-0000000000000000000000000000000000000000
+000000010000000200000059-0000000000000000000000000000000000000000.gz
+00000001000000020000005A-0000000000000000000000000000000000000000.gz
+00000001000000020000005B-0000000000000000000000000000000000000000
+00000001000000020000005C-0000000000000000000000000000000000000000.gz
+00000001000000020000005D-0000000000000000000000000000000000000000.gz
+00000001000000020000005E-0000000000000000000000000000000000000000
+00000001000000020000005F-0000000000000000000000000000000000000000.gz
+000000010000000200000060-0000000000000000000000000000000000000000.gz
+000000010000000200000061-0000000000000000000000000000000000000000
+000000010000000200000062-0000000000000000000000000000000000000000.gz
+000000010000000200000063-0000000000000000000000000000000000000000.gz
+000000010000000200000064-0000000000000000000000000000000000000000
+000000010000000200000065-0000000000000000000000000000000000000000.gz
+000000010000000200000066-0000000000000000000000000000000000000000.gz
+000000010000000200000067-0000000000000000000000000000000000000000
+000000010000000200000068-0000000000000000000000000000000000000000.gz
+000000010000000200000069-0000000000000000000000000000000000000000.gz
+00000001000000020000006A-0000000000000000000000000000000000000000
+00000001000000020000006B-0000000000000000000000000000000000000000.gz
+00000001000000020000006C-0000000000000000000000000000000000000000.gz
+00000001000000020000006D-0000000000000000000000000000000000000000
+00000001000000020000006E-0000000000000000000000000000000000000000.gz
+00000001000000020000006F-0000000000000000000000000000000000000000.gz
+000000010000000200000070-0000000000000000000000000000000000000000
+000000010000000200000071-0000000000000000000000000000000000000000.gz
diff --git a/test/expect/expire-expire-002.log b/test/expect/expire-expire-002.log
new file mode 100644
index 000000000..0ba65d2cf
--- /dev/null
+++ b/test/expect/expire-expire-002.log
@@ -0,0 +1,1399 @@
+run 002 - Expire::stanzaUpgrade
+===============================
+
+* full backup: label = [BACKUP-FULL-1], start = 000000010000000000000000, stop = 000000010000000000000002
+* incr backup: label = [BACKUP-INCR-1], prior = [BACKUP-FULL-1], start = 000000010000000000000006, stop = 000000010000000000000008
+* full backup: label = [BACKUP-FULL-2], start = 00000001000000000000000C, stop = 00000001000000000000000E
+====================================================================================================================================
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-INCR-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"000000010000000000000008","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-1]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000000000000C","backup-archive-stop":"00000001000000000000000E","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201204301
+db-control-version=922
+db-id=1
+db-system-id=6393320793115174899
+db-version="9.2"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-1]
+[BACKUP-INCR-1]
+[BACKUP-FULL-2]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.2-1
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1:
+0000000100000000
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000003-0000000000000000000000000000000000000000.gz
+000000010000000000000004-0000000000000000000000000000000000000000
+000000010000000000000005-0000000000000000000000000000000000000000.gz
+000000010000000000000006-0000000000000000000000000000000000000000.gz
+000000010000000000000007-0000000000000000000000000000000000000000
+000000010000000000000008-0000000000000000000000000000000000000000.gz
+000000010000000000000009-0000000000000000000000000000000000000000.gz
+00000001000000000000000A-0000000000000000000000000000000000000000
+00000001000000000000000B-0000000000000000000000000000000000000000.gz
+00000001000000000000000C-0000000000000000000000000000000000000000.gz
+00000001000000000000000D-0000000000000000000000000000000000000000
+00000001000000000000000E-0000000000000000000000000000000000000000.gz
+00000001000000000000000F-0000000000000000000000000000000000000000.gz
+000000010000000000000010-0000000000000000000000000000000000000000
+000000010000000000000011-0000000000000000000000000000000000000000.gz
+
+Create backups in current db version
+> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config="[TEST_PATH]/db-master/pgbackrest.conf" --stanza=db --log-level-console=detail --retention-archive-type=diff expire
+------------------------------------------------------------------------------------------------------------------------------------
+P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-master/pgbackrest.conf --lock-path=[TEST_PATH]/db-master/repo/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/repo/log --repo-path=[TEST_PATH]/db-master/repo --retention-archive-type=diff --stanza=db
+P00 WARN: option retention-full is not set, the repository may run out of space
+ HINT: to retain full backups indefinitely (without warning), set option 'retention-full' to the maximum.
+P00 WARN: WAL segments will not be expired: option 'retention-archive-type=diff' but neither option 'retention-archive' nor option 'retention-diff' is set
+P00 INFO: option 'retention-archive' is not set - archive logs will not be expired
+P00 INFO: expire command end: completed successfully
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-INCR-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"000000010000000000000008","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-1]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000000000000C","backup-archive-stop":"00000001000000000000000E","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201204301
+db-control-version=922
+db-id=1
+db-system-id=6393320793115174899
+db-version="9.2"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-1]
+[BACKUP-INCR-1]
+[BACKUP-FULL-2]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.2-1
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1:
+0000000100000000
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000003-0000000000000000000000000000000000000000.gz
+000000010000000000000004-0000000000000000000000000000000000000000
+000000010000000000000005-0000000000000000000000000000000000000000.gz
+000000010000000000000006-0000000000000000000000000000000000000000.gz
+000000010000000000000007-0000000000000000000000000000000000000000
+000000010000000000000008-0000000000000000000000000000000000000000.gz
+000000010000000000000009-0000000000000000000000000000000000000000.gz
+00000001000000000000000A-0000000000000000000000000000000000000000
+00000001000000000000000B-0000000000000000000000000000000000000000.gz
+00000001000000000000000C-0000000000000000000000000000000000000000.gz
+00000001000000000000000D-0000000000000000000000000000000000000000
+00000001000000000000000E-0000000000000000000000000000000000000000.gz
+00000001000000000000000F-0000000000000000000000000000000000000000.gz
+000000010000000000000010-0000000000000000000000000000000000000000
+000000010000000000000011-0000000000000000000000000000000000000000.gz
+
+* full backup: label = [BACKUP-FULL-3], start = 000000010000000000000000, stop = 000000010000000000000002
+* incr backup: label = [BACKUP-INCR-2], prior = [BACKUP-FULL-3], start = 000000010000000000000006, stop = 0000000100000000000000FB
+* full backup: label = [BACKUP-FULL-4], start = 0000000100000000000000FF, stop = 000000010000000100000001
+* diff backup: label = [BACKUP-DIFF-1], prior = [BACKUP-FULL-4], start = 000000010000000100000005, stop = 000000010000000100000007
+====================================================================================================================================
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-INCR-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"000000010000000000000008","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-1]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000000000000C","backup-archive-stop":"00000001000000000000000E","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-3]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-INCR-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"0000000100000000000000FB","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-3]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"0000000100000000000000FF","backup-archive-stop":"000000010000000100000001","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-DIFF-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000100000005","backup-archive-stop":"000000010000000100000007","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-4]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201306121
+db-control-version=937
+db-id=2
+db-system-id=6395542721432104958
+db-version="9.3"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":6395542721432104958,"db-version":"9.3"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-1]
+[BACKUP-INCR-1]
+[BACKUP-FULL-2]
+[BACKUP-FULL-3]
+[BACKUP-INCR-2]
+[BACKUP-FULL-4]
+[BACKUP-DIFF-1]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.2-1
+9.3-2
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1:
+0000000100000000
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000003-0000000000000000000000000000000000000000.gz
+000000010000000000000004-0000000000000000000000000000000000000000
+000000010000000000000005-0000000000000000000000000000000000000000.gz
+000000010000000000000006-0000000000000000000000000000000000000000.gz
+000000010000000000000007-0000000000000000000000000000000000000000
+000000010000000000000008-0000000000000000000000000000000000000000.gz
+000000010000000000000009-0000000000000000000000000000000000000000.gz
+00000001000000000000000A-0000000000000000000000000000000000000000
+00000001000000000000000B-0000000000000000000000000000000000000000.gz
+00000001000000000000000C-0000000000000000000000000000000000000000.gz
+00000001000000000000000D-0000000000000000000000000000000000000000
+00000001000000000000000E-0000000000000000000000000000000000000000.gz
+00000001000000000000000F-0000000000000000000000000000000000000000.gz
+000000010000000000000010-0000000000000000000000000000000000000000
+000000010000000000000011-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2:
+0000000100000000
+0000000100000001
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000003-0000000000000000000000000000000000000000.gz
+000000010000000000000004-0000000000000000000000000000000000000000
+000000010000000000000005-0000000000000000000000000000000000000000.gz
+000000010000000000000006-0000000000000000000000000000000000000000.gz
+000000010000000000000007-0000000000000000000000000000000000000000
+000000010000000000000008-0000000000000000000000000000000000000000.gz
+000000010000000000000009-0000000000000000000000000000000000000000
+00000001000000000000000A-0000000000000000000000000000000000000000.gz
+00000001000000000000000B-0000000000000000000000000000000000000000
+00000001000000000000000C-0000000000000000000000000000000000000000.gz
+00000001000000000000000D-0000000000000000000000000000000000000000
+00000001000000000000000E-0000000000000000000000000000000000000000.gz
+00000001000000000000000F-0000000000000000000000000000000000000000
+000000010000000000000010-0000000000000000000000000000000000000000.gz
+000000010000000000000011-0000000000000000000000000000000000000000
+000000010000000000000012-0000000000000000000000000000000000000000.gz
+000000010000000000000013-0000000000000000000000000000000000000000
+000000010000000000000014-0000000000000000000000000000000000000000.gz
+000000010000000000000015-0000000000000000000000000000000000000000
+000000010000000000000016-0000000000000000000000000000000000000000.gz
+000000010000000000000017-0000000000000000000000000000000000000000
+000000010000000000000018-0000000000000000000000000000000000000000.gz
+000000010000000000000019-0000000000000000000000000000000000000000
+00000001000000000000001A-0000000000000000000000000000000000000000.gz
+00000001000000000000001B-0000000000000000000000000000000000000000
+00000001000000000000001C-0000000000000000000000000000000000000000.gz
+00000001000000000000001D-0000000000000000000000000000000000000000
+00000001000000000000001E-0000000000000000000000000000000000000000.gz
+00000001000000000000001F-0000000000000000000000000000000000000000
+000000010000000000000020-0000000000000000000000000000000000000000.gz
+000000010000000000000021-0000000000000000000000000000000000000000
+000000010000000000000022-0000000000000000000000000000000000000000.gz
+000000010000000000000023-0000000000000000000000000000000000000000
+000000010000000000000024-0000000000000000000000000000000000000000.gz
+000000010000000000000025-0000000000000000000000000000000000000000
+000000010000000000000026-0000000000000000000000000000000000000000.gz
+000000010000000000000027-0000000000000000000000000000000000000000
+000000010000000000000028-0000000000000000000000000000000000000000.gz
+000000010000000000000029-0000000000000000000000000000000000000000
+00000001000000000000002A-0000000000000000000000000000000000000000.gz
+00000001000000000000002B-0000000000000000000000000000000000000000
+00000001000000000000002C-0000000000000000000000000000000000000000.gz
+00000001000000000000002D-0000000000000000000000000000000000000000
+00000001000000000000002E-0000000000000000000000000000000000000000.gz
+00000001000000000000002F-0000000000000000000000000000000000000000
+000000010000000000000030-0000000000000000000000000000000000000000.gz
+000000010000000000000031-0000000000000000000000000000000000000000
+000000010000000000000032-0000000000000000000000000000000000000000.gz
+000000010000000000000033-0000000000000000000000000000000000000000
+000000010000000000000034-0000000000000000000000000000000000000000.gz
+000000010000000000000035-0000000000000000000000000000000000000000
+000000010000000000000036-0000000000000000000000000000000000000000.gz
+000000010000000000000037-0000000000000000000000000000000000000000
+000000010000000000000038-0000000000000000000000000000000000000000.gz
+000000010000000000000039-0000000000000000000000000000000000000000
+00000001000000000000003A-0000000000000000000000000000000000000000.gz
+00000001000000000000003B-0000000000000000000000000000000000000000
+00000001000000000000003C-0000000000000000000000000000000000000000.gz
+00000001000000000000003D-0000000000000000000000000000000000000000
+00000001000000000000003E-0000000000000000000000000000000000000000.gz
+00000001000000000000003F-0000000000000000000000000000000000000000
+000000010000000000000040-0000000000000000000000000000000000000000.gz
+000000010000000000000041-0000000000000000000000000000000000000000
+000000010000000000000042-0000000000000000000000000000000000000000.gz
+000000010000000000000043-0000000000000000000000000000000000000000
+000000010000000000000044-0000000000000000000000000000000000000000.gz
+000000010000000000000045-0000000000000000000000000000000000000000
+000000010000000000000046-0000000000000000000000000000000000000000.gz
+000000010000000000000047-0000000000000000000000000000000000000000
+000000010000000000000048-0000000000000000000000000000000000000000.gz
+000000010000000000000049-0000000000000000000000000000000000000000
+00000001000000000000004A-0000000000000000000000000000000000000000.gz
+00000001000000000000004B-0000000000000000000000000000000000000000
+00000001000000000000004C-0000000000000000000000000000000000000000.gz
+00000001000000000000004D-0000000000000000000000000000000000000000
+00000001000000000000004E-0000000000000000000000000000000000000000.gz
+00000001000000000000004F-0000000000000000000000000000000000000000
+000000010000000000000050-0000000000000000000000000000000000000000.gz
+000000010000000000000051-0000000000000000000000000000000000000000
+000000010000000000000052-0000000000000000000000000000000000000000.gz
+000000010000000000000053-0000000000000000000000000000000000000000
+000000010000000000000054-0000000000000000000000000000000000000000.gz
+000000010000000000000055-0000000000000000000000000000000000000000
+000000010000000000000056-0000000000000000000000000000000000000000.gz
+000000010000000000000057-0000000000000000000000000000000000000000
+000000010000000000000058-0000000000000000000000000000000000000000.gz
+000000010000000000000059-0000000000000000000000000000000000000000
+00000001000000000000005A-0000000000000000000000000000000000000000.gz
+00000001000000000000005B-0000000000000000000000000000000000000000
+00000001000000000000005C-0000000000000000000000000000000000000000.gz
+00000001000000000000005D-0000000000000000000000000000000000000000
+00000001000000000000005E-0000000000000000000000000000000000000000.gz
+00000001000000000000005F-0000000000000000000000000000000000000000
+000000010000000000000060-0000000000000000000000000000000000000000.gz
+000000010000000000000061-0000000000000000000000000000000000000000
+000000010000000000000062-0000000000000000000000000000000000000000.gz
+000000010000000000000063-0000000000000000000000000000000000000000
+000000010000000000000064-0000000000000000000000000000000000000000.gz
+000000010000000000000065-0000000000000000000000000000000000000000
+000000010000000000000066-0000000000000000000000000000000000000000.gz
+000000010000000000000067-0000000000000000000000000000000000000000
+000000010000000000000068-0000000000000000000000000000000000000000.gz
+000000010000000000000069-0000000000000000000000000000000000000000
+00000001000000000000006A-0000000000000000000000000000000000000000.gz
+00000001000000000000006B-0000000000000000000000000000000000000000
+00000001000000000000006C-0000000000000000000000000000000000000000.gz
+00000001000000000000006D-0000000000000000000000000000000000000000
+00000001000000000000006E-0000000000000000000000000000000000000000.gz
+00000001000000000000006F-0000000000000000000000000000000000000000
+000000010000000000000070-0000000000000000000000000000000000000000.gz
+000000010000000000000071-0000000000000000000000000000000000000000
+000000010000000000000072-0000000000000000000000000000000000000000.gz
+000000010000000000000073-0000000000000000000000000000000000000000
+000000010000000000000074-0000000000000000000000000000000000000000.gz
+000000010000000000000075-0000000000000000000000000000000000000000
+000000010000000000000076-0000000000000000000000000000000000000000.gz
+000000010000000000000077-0000000000000000000000000000000000000000
+000000010000000000000078-0000000000000000000000000000000000000000.gz
+000000010000000000000079-0000000000000000000000000000000000000000
+00000001000000000000007A-0000000000000000000000000000000000000000.gz
+00000001000000000000007B-0000000000000000000000000000000000000000
+00000001000000000000007C-0000000000000000000000000000000000000000.gz
+00000001000000000000007D-0000000000000000000000000000000000000000
+00000001000000000000007E-0000000000000000000000000000000000000000.gz
+00000001000000000000007F-0000000000000000000000000000000000000000
+000000010000000000000080-0000000000000000000000000000000000000000.gz
+000000010000000000000081-0000000000000000000000000000000000000000
+000000010000000000000082-0000000000000000000000000000000000000000.gz
+000000010000000000000083-0000000000000000000000000000000000000000
+000000010000000000000084-0000000000000000000000000000000000000000.gz
+000000010000000000000085-0000000000000000000000000000000000000000
+000000010000000000000086-0000000000000000000000000000000000000000.gz
+000000010000000000000087-0000000000000000000000000000000000000000
+000000010000000000000088-0000000000000000000000000000000000000000.gz
+000000010000000000000089-0000000000000000000000000000000000000000
+00000001000000000000008A-0000000000000000000000000000000000000000.gz
+00000001000000000000008B-0000000000000000000000000000000000000000
+00000001000000000000008C-0000000000000000000000000000000000000000.gz
+00000001000000000000008D-0000000000000000000000000000000000000000
+00000001000000000000008E-0000000000000000000000000000000000000000.gz
+00000001000000000000008F-0000000000000000000000000000000000000000
+000000010000000000000090-0000000000000000000000000000000000000000.gz
+000000010000000000000091-0000000000000000000000000000000000000000
+000000010000000000000092-0000000000000000000000000000000000000000.gz
+000000010000000000000093-0000000000000000000000000000000000000000
+000000010000000000000094-0000000000000000000000000000000000000000.gz
+000000010000000000000095-0000000000000000000000000000000000000000
+000000010000000000000096-0000000000000000000000000000000000000000.gz
+000000010000000000000097-0000000000000000000000000000000000000000
+000000010000000000000098-0000000000000000000000000000000000000000.gz
+000000010000000000000099-0000000000000000000000000000000000000000
+00000001000000000000009A-0000000000000000000000000000000000000000.gz
+00000001000000000000009B-0000000000000000000000000000000000000000
+00000001000000000000009C-0000000000000000000000000000000000000000.gz
+00000001000000000000009D-0000000000000000000000000000000000000000
+00000001000000000000009E-0000000000000000000000000000000000000000.gz
+00000001000000000000009F-0000000000000000000000000000000000000000
+0000000100000000000000A0-0000000000000000000000000000000000000000.gz
+0000000100000000000000A1-0000000000000000000000000000000000000000
+0000000100000000000000A2-0000000000000000000000000000000000000000.gz
+0000000100000000000000A3-0000000000000000000000000000000000000000
+0000000100000000000000A4-0000000000000000000000000000000000000000.gz
+0000000100000000000000A5-0000000000000000000000000000000000000000
+0000000100000000000000A6-0000000000000000000000000000000000000000.gz
+0000000100000000000000A7-0000000000000000000000000000000000000000
+0000000100000000000000A8-0000000000000000000000000000000000000000.gz
+0000000100000000000000A9-0000000000000000000000000000000000000000
+0000000100000000000000AA-0000000000000000000000000000000000000000.gz
+0000000100000000000000AB-0000000000000000000000000000000000000000
+0000000100000000000000AC-0000000000000000000000000000000000000000.gz
+0000000100000000000000AD-0000000000000000000000000000000000000000
+0000000100000000000000AE-0000000000000000000000000000000000000000.gz
+0000000100000000000000AF-0000000000000000000000000000000000000000
+0000000100000000000000B0-0000000000000000000000000000000000000000.gz
+0000000100000000000000B1-0000000000000000000000000000000000000000
+0000000100000000000000B2-0000000000000000000000000000000000000000.gz
+0000000100000000000000B3-0000000000000000000000000000000000000000
+0000000100000000000000B4-0000000000000000000000000000000000000000.gz
+0000000100000000000000B5-0000000000000000000000000000000000000000
+0000000100000000000000B6-0000000000000000000000000000000000000000.gz
+0000000100000000000000B7-0000000000000000000000000000000000000000
+0000000100000000000000B8-0000000000000000000000000000000000000000.gz
+0000000100000000000000B9-0000000000000000000000000000000000000000
+0000000100000000000000BA-0000000000000000000000000000000000000000.gz
+0000000100000000000000BB-0000000000000000000000000000000000000000
+0000000100000000000000BC-0000000000000000000000000000000000000000.gz
+0000000100000000000000BD-0000000000000000000000000000000000000000
+0000000100000000000000BE-0000000000000000000000000000000000000000.gz
+0000000100000000000000BF-0000000000000000000000000000000000000000
+0000000100000000000000C0-0000000000000000000000000000000000000000.gz
+0000000100000000000000C1-0000000000000000000000000000000000000000
+0000000100000000000000C2-0000000000000000000000000000000000000000.gz
+0000000100000000000000C3-0000000000000000000000000000000000000000
+0000000100000000000000C4-0000000000000000000000000000000000000000.gz
+0000000100000000000000C5-0000000000000000000000000000000000000000
+0000000100000000000000C6-0000000000000000000000000000000000000000.gz
+0000000100000000000000C7-0000000000000000000000000000000000000000
+0000000100000000000000C8-0000000000000000000000000000000000000000.gz
+0000000100000000000000C9-0000000000000000000000000000000000000000
+0000000100000000000000CA-0000000000000000000000000000000000000000.gz
+0000000100000000000000CB-0000000000000000000000000000000000000000
+0000000100000000000000CC-0000000000000000000000000000000000000000.gz
+0000000100000000000000CD-0000000000000000000000000000000000000000
+0000000100000000000000CE-0000000000000000000000000000000000000000.gz
+0000000100000000000000CF-0000000000000000000000000000000000000000
+0000000100000000000000D0-0000000000000000000000000000000000000000.gz
+0000000100000000000000D1-0000000000000000000000000000000000000000
+0000000100000000000000D2-0000000000000000000000000000000000000000.gz
+0000000100000000000000D3-0000000000000000000000000000000000000000
+0000000100000000000000D4-0000000000000000000000000000000000000000.gz
+0000000100000000000000D5-0000000000000000000000000000000000000000
+0000000100000000000000D6-0000000000000000000000000000000000000000.gz
+0000000100000000000000D7-0000000000000000000000000000000000000000
+0000000100000000000000D8-0000000000000000000000000000000000000000.gz
+0000000100000000000000D9-0000000000000000000000000000000000000000
+0000000100000000000000DA-0000000000000000000000000000000000000000.gz
+0000000100000000000000DB-0000000000000000000000000000000000000000
+0000000100000000000000DC-0000000000000000000000000000000000000000.gz
+0000000100000000000000DD-0000000000000000000000000000000000000000
+0000000100000000000000DE-0000000000000000000000000000000000000000.gz
+0000000100000000000000DF-0000000000000000000000000000000000000000
+0000000100000000000000E0-0000000000000000000000000000000000000000.gz
+0000000100000000000000E1-0000000000000000000000000000000000000000
+0000000100000000000000E2-0000000000000000000000000000000000000000.gz
+0000000100000000000000E3-0000000000000000000000000000000000000000
+0000000100000000000000E4-0000000000000000000000000000000000000000.gz
+0000000100000000000000E5-0000000000000000000000000000000000000000
+0000000100000000000000E6-0000000000000000000000000000000000000000.gz
+0000000100000000000000E7-0000000000000000000000000000000000000000
+0000000100000000000000E8-0000000000000000000000000000000000000000.gz
+0000000100000000000000E9-0000000000000000000000000000000000000000
+0000000100000000000000EA-0000000000000000000000000000000000000000.gz
+0000000100000000000000EB-0000000000000000000000000000000000000000
+0000000100000000000000EC-0000000000000000000000000000000000000000.gz
+0000000100000000000000ED-0000000000000000000000000000000000000000
+0000000100000000000000EE-0000000000000000000000000000000000000000.gz
+0000000100000000000000EF-0000000000000000000000000000000000000000
+0000000100000000000000F0-0000000000000000000000000000000000000000.gz
+0000000100000000000000F1-0000000000000000000000000000000000000000
+0000000100000000000000F2-0000000000000000000000000000000000000000.gz
+0000000100000000000000F3-0000000000000000000000000000000000000000
+0000000100000000000000F4-0000000000000000000000000000000000000000.gz
+0000000100000000000000F5-0000000000000000000000000000000000000000
+0000000100000000000000F6-0000000000000000000000000000000000000000.gz
+0000000100000000000000F7-0000000000000000000000000000000000000000
+0000000100000000000000F8-0000000000000000000000000000000000000000.gz
+0000000100000000000000F9-0000000000000000000000000000000000000000
+0000000100000000000000FA-0000000000000000000000000000000000000000.gz
+0000000100000000000000FB-0000000000000000000000000000000000000000
+0000000100000000000000FC-0000000000000000000000000000000000000000.gz
+0000000100000000000000FD-0000000000000000000000000000000000000000
+0000000100000000000000FE-0000000000000000000000000000000000000000.gz
+0000000100000000000000FF-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000001:
+000000010000000100000000-0000000000000000000000000000000000000000
+000000010000000100000001-0000000000000000000000000000000000000000.gz
+000000010000000100000002-0000000000000000000000000000000000000000.gz
+000000010000000100000003-0000000000000000000000000000000000000000
+000000010000000100000004-0000000000000000000000000000000000000000.gz
+000000010000000100000005-0000000000000000000000000000000000000000.gz
+000000010000000100000006-0000000000000000000000000000000000000000
+000000010000000100000007-0000000000000000000000000000000000000000.gz
+000000010000000100000008-0000000000000000000000000000000000000000.gz
+000000010000000100000009-0000000000000000000000000000000000000000
+00000001000000010000000A-0000000000000000000000000000000000000000.gz
+
+Upgrade stanza and expire only earliest db backup and archive
+> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config="[TEST_PATH]/db-master/pgbackrest.conf" --stanza=db --log-level-console=detail --retention-full=3 --retention-archive-type=full expire
+------------------------------------------------------------------------------------------------------------------------------------
+P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-master/pgbackrest.conf --lock-path=[TEST_PATH]/db-master/repo/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/repo/log --repo-path=[TEST_PATH]/db-master/repo --retention-archive-type=full --retention-full=3 --stanza=db
+P00 INFO: expire full backup set: [BACKUP-FULL-1], [BACKUP-INCR-1]
+P00 INFO: remove expired backup [BACKUP-INCR-1]
+P00 INFO: remove expired backup [BACKUP-FULL-1]
+P00 DETAIL: archive retention on backup [BACKUP-FULL-2], archiveId = 9.2-1, start = 00000001000000000000000C
+P00 DETAIL: remove archive: start = 000000010000000000000000, stop = 00000001000000000000000B
+P00 DETAIL: archive retention on backup [BACKUP-FULL-3], archiveId = 9.3-2, start = 000000010000000000000000
+P00 INFO: expire command end: completed successfully
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000000000000C","backup-archive-stop":"00000001000000000000000E","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-3]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-INCR-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"0000000100000000000000FB","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-3]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"0000000100000000000000FF","backup-archive-stop":"000000010000000100000001","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-DIFF-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000100000005","backup-archive-stop":"000000010000000100000007","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-4]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201306121
+db-control-version=937
+db-id=2
+db-system-id=6395542721432104958
+db-version="9.3"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":6395542721432104958,"db-version":"9.3"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-2]
+[BACKUP-FULL-3]
+[BACKUP-INCR-2]
+[BACKUP-FULL-4]
+[BACKUP-DIFF-1]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.2-1
+9.3-2
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1:
+0000000100000000
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1/0000000100000000:
+00000001000000000000000C-0000000000000000000000000000000000000000.gz
+00000001000000000000000D-0000000000000000000000000000000000000000
+00000001000000000000000E-0000000000000000000000000000000000000000.gz
+00000001000000000000000F-0000000000000000000000000000000000000000.gz
+000000010000000000000010-0000000000000000000000000000000000000000
+000000010000000000000011-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2:
+0000000100000000
+0000000100000001
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000003-0000000000000000000000000000000000000000.gz
+000000010000000000000004-0000000000000000000000000000000000000000
+000000010000000000000005-0000000000000000000000000000000000000000.gz
+000000010000000000000006-0000000000000000000000000000000000000000.gz
+000000010000000000000007-0000000000000000000000000000000000000000
+000000010000000000000008-0000000000000000000000000000000000000000.gz
+000000010000000000000009-0000000000000000000000000000000000000000
+00000001000000000000000A-0000000000000000000000000000000000000000.gz
+00000001000000000000000B-0000000000000000000000000000000000000000
+00000001000000000000000C-0000000000000000000000000000000000000000.gz
+00000001000000000000000D-0000000000000000000000000000000000000000
+00000001000000000000000E-0000000000000000000000000000000000000000.gz
+00000001000000000000000F-0000000000000000000000000000000000000000
+000000010000000000000010-0000000000000000000000000000000000000000.gz
+000000010000000000000011-0000000000000000000000000000000000000000
+000000010000000000000012-0000000000000000000000000000000000000000.gz
+000000010000000000000013-0000000000000000000000000000000000000000
+000000010000000000000014-0000000000000000000000000000000000000000.gz
+000000010000000000000015-0000000000000000000000000000000000000000
+000000010000000000000016-0000000000000000000000000000000000000000.gz
+000000010000000000000017-0000000000000000000000000000000000000000
+000000010000000000000018-0000000000000000000000000000000000000000.gz
+000000010000000000000019-0000000000000000000000000000000000000000
+00000001000000000000001A-0000000000000000000000000000000000000000.gz
+00000001000000000000001B-0000000000000000000000000000000000000000
+00000001000000000000001C-0000000000000000000000000000000000000000.gz
+00000001000000000000001D-0000000000000000000000000000000000000000
+00000001000000000000001E-0000000000000000000000000000000000000000.gz
+00000001000000000000001F-0000000000000000000000000000000000000000
+000000010000000000000020-0000000000000000000000000000000000000000.gz
+000000010000000000000021-0000000000000000000000000000000000000000
+000000010000000000000022-0000000000000000000000000000000000000000.gz
+000000010000000000000023-0000000000000000000000000000000000000000
+000000010000000000000024-0000000000000000000000000000000000000000.gz
+000000010000000000000025-0000000000000000000000000000000000000000
+000000010000000000000026-0000000000000000000000000000000000000000.gz
+000000010000000000000027-0000000000000000000000000000000000000000
+000000010000000000000028-0000000000000000000000000000000000000000.gz
+000000010000000000000029-0000000000000000000000000000000000000000
+00000001000000000000002A-0000000000000000000000000000000000000000.gz
+00000001000000000000002B-0000000000000000000000000000000000000000
+00000001000000000000002C-0000000000000000000000000000000000000000.gz
+00000001000000000000002D-0000000000000000000000000000000000000000
+00000001000000000000002E-0000000000000000000000000000000000000000.gz
+00000001000000000000002F-0000000000000000000000000000000000000000
+000000010000000000000030-0000000000000000000000000000000000000000.gz
+000000010000000000000031-0000000000000000000000000000000000000000
+000000010000000000000032-0000000000000000000000000000000000000000.gz
+000000010000000000000033-0000000000000000000000000000000000000000
+000000010000000000000034-0000000000000000000000000000000000000000.gz
+000000010000000000000035-0000000000000000000000000000000000000000
+000000010000000000000036-0000000000000000000000000000000000000000.gz
+000000010000000000000037-0000000000000000000000000000000000000000
+000000010000000000000038-0000000000000000000000000000000000000000.gz
+000000010000000000000039-0000000000000000000000000000000000000000
+00000001000000000000003A-0000000000000000000000000000000000000000.gz
+00000001000000000000003B-0000000000000000000000000000000000000000
+00000001000000000000003C-0000000000000000000000000000000000000000.gz
+00000001000000000000003D-0000000000000000000000000000000000000000
+00000001000000000000003E-0000000000000000000000000000000000000000.gz
+00000001000000000000003F-0000000000000000000000000000000000000000
+000000010000000000000040-0000000000000000000000000000000000000000.gz
+000000010000000000000041-0000000000000000000000000000000000000000
+000000010000000000000042-0000000000000000000000000000000000000000.gz
+000000010000000000000043-0000000000000000000000000000000000000000
+000000010000000000000044-0000000000000000000000000000000000000000.gz
+000000010000000000000045-0000000000000000000000000000000000000000
+000000010000000000000046-0000000000000000000000000000000000000000.gz
+000000010000000000000047-0000000000000000000000000000000000000000
+000000010000000000000048-0000000000000000000000000000000000000000.gz
+000000010000000000000049-0000000000000000000000000000000000000000
+00000001000000000000004A-0000000000000000000000000000000000000000.gz
+00000001000000000000004B-0000000000000000000000000000000000000000
+00000001000000000000004C-0000000000000000000000000000000000000000.gz
+00000001000000000000004D-0000000000000000000000000000000000000000
+00000001000000000000004E-0000000000000000000000000000000000000000.gz
+00000001000000000000004F-0000000000000000000000000000000000000000
+000000010000000000000050-0000000000000000000000000000000000000000.gz
+000000010000000000000051-0000000000000000000000000000000000000000
+000000010000000000000052-0000000000000000000000000000000000000000.gz
+000000010000000000000053-0000000000000000000000000000000000000000
+000000010000000000000054-0000000000000000000000000000000000000000.gz
+000000010000000000000055-0000000000000000000000000000000000000000
+000000010000000000000056-0000000000000000000000000000000000000000.gz
+000000010000000000000057-0000000000000000000000000000000000000000
+000000010000000000000058-0000000000000000000000000000000000000000.gz
+000000010000000000000059-0000000000000000000000000000000000000000
+00000001000000000000005A-0000000000000000000000000000000000000000.gz
+00000001000000000000005B-0000000000000000000000000000000000000000
+00000001000000000000005C-0000000000000000000000000000000000000000.gz
+00000001000000000000005D-0000000000000000000000000000000000000000
+00000001000000000000005E-0000000000000000000000000000000000000000.gz
+00000001000000000000005F-0000000000000000000000000000000000000000
+000000010000000000000060-0000000000000000000000000000000000000000.gz
+000000010000000000000061-0000000000000000000000000000000000000000
+000000010000000000000062-0000000000000000000000000000000000000000.gz
+000000010000000000000063-0000000000000000000000000000000000000000
+000000010000000000000064-0000000000000000000000000000000000000000.gz
+000000010000000000000065-0000000000000000000000000000000000000000
+000000010000000000000066-0000000000000000000000000000000000000000.gz
+000000010000000000000067-0000000000000000000000000000000000000000
+000000010000000000000068-0000000000000000000000000000000000000000.gz
+000000010000000000000069-0000000000000000000000000000000000000000
+00000001000000000000006A-0000000000000000000000000000000000000000.gz
+00000001000000000000006B-0000000000000000000000000000000000000000
+00000001000000000000006C-0000000000000000000000000000000000000000.gz
+00000001000000000000006D-0000000000000000000000000000000000000000
+00000001000000000000006E-0000000000000000000000000000000000000000.gz
+00000001000000000000006F-0000000000000000000000000000000000000000
+000000010000000000000070-0000000000000000000000000000000000000000.gz
+000000010000000000000071-0000000000000000000000000000000000000000
+000000010000000000000072-0000000000000000000000000000000000000000.gz
+000000010000000000000073-0000000000000000000000000000000000000000
+000000010000000000000074-0000000000000000000000000000000000000000.gz
+000000010000000000000075-0000000000000000000000000000000000000000
+000000010000000000000076-0000000000000000000000000000000000000000.gz
+000000010000000000000077-0000000000000000000000000000000000000000
+000000010000000000000078-0000000000000000000000000000000000000000.gz
+000000010000000000000079-0000000000000000000000000000000000000000
+00000001000000000000007A-0000000000000000000000000000000000000000.gz
+00000001000000000000007B-0000000000000000000000000000000000000000
+00000001000000000000007C-0000000000000000000000000000000000000000.gz
+00000001000000000000007D-0000000000000000000000000000000000000000
+00000001000000000000007E-0000000000000000000000000000000000000000.gz
+00000001000000000000007F-0000000000000000000000000000000000000000
+000000010000000000000080-0000000000000000000000000000000000000000.gz
+000000010000000000000081-0000000000000000000000000000000000000000
+000000010000000000000082-0000000000000000000000000000000000000000.gz
+000000010000000000000083-0000000000000000000000000000000000000000
+000000010000000000000084-0000000000000000000000000000000000000000.gz
+000000010000000000000085-0000000000000000000000000000000000000000
+000000010000000000000086-0000000000000000000000000000000000000000.gz
+000000010000000000000087-0000000000000000000000000000000000000000
+000000010000000000000088-0000000000000000000000000000000000000000.gz
+000000010000000000000089-0000000000000000000000000000000000000000
+00000001000000000000008A-0000000000000000000000000000000000000000.gz
+00000001000000000000008B-0000000000000000000000000000000000000000
+00000001000000000000008C-0000000000000000000000000000000000000000.gz
+00000001000000000000008D-0000000000000000000000000000000000000000
+00000001000000000000008E-0000000000000000000000000000000000000000.gz
+00000001000000000000008F-0000000000000000000000000000000000000000
+000000010000000000000090-0000000000000000000000000000000000000000.gz
+000000010000000000000091-0000000000000000000000000000000000000000
+000000010000000000000092-0000000000000000000000000000000000000000.gz
+000000010000000000000093-0000000000000000000000000000000000000000
+000000010000000000000094-0000000000000000000000000000000000000000.gz
+000000010000000000000095-0000000000000000000000000000000000000000
+000000010000000000000096-0000000000000000000000000000000000000000.gz
+000000010000000000000097-0000000000000000000000000000000000000000
+000000010000000000000098-0000000000000000000000000000000000000000.gz
+000000010000000000000099-0000000000000000000000000000000000000000
+00000001000000000000009A-0000000000000000000000000000000000000000.gz
+00000001000000000000009B-0000000000000000000000000000000000000000
+00000001000000000000009C-0000000000000000000000000000000000000000.gz
+00000001000000000000009D-0000000000000000000000000000000000000000
+00000001000000000000009E-0000000000000000000000000000000000000000.gz
+00000001000000000000009F-0000000000000000000000000000000000000000
+0000000100000000000000A0-0000000000000000000000000000000000000000.gz
+0000000100000000000000A1-0000000000000000000000000000000000000000
+0000000100000000000000A2-0000000000000000000000000000000000000000.gz
+0000000100000000000000A3-0000000000000000000000000000000000000000
+0000000100000000000000A4-0000000000000000000000000000000000000000.gz
+0000000100000000000000A5-0000000000000000000000000000000000000000
+0000000100000000000000A6-0000000000000000000000000000000000000000.gz
+0000000100000000000000A7-0000000000000000000000000000000000000000
+0000000100000000000000A8-0000000000000000000000000000000000000000.gz
+0000000100000000000000A9-0000000000000000000000000000000000000000
+0000000100000000000000AA-0000000000000000000000000000000000000000.gz
+0000000100000000000000AB-0000000000000000000000000000000000000000
+0000000100000000000000AC-0000000000000000000000000000000000000000.gz
+0000000100000000000000AD-0000000000000000000000000000000000000000
+0000000100000000000000AE-0000000000000000000000000000000000000000.gz
+0000000100000000000000AF-0000000000000000000000000000000000000000
+0000000100000000000000B0-0000000000000000000000000000000000000000.gz
+0000000100000000000000B1-0000000000000000000000000000000000000000
+0000000100000000000000B2-0000000000000000000000000000000000000000.gz
+0000000100000000000000B3-0000000000000000000000000000000000000000
+0000000100000000000000B4-0000000000000000000000000000000000000000.gz
+0000000100000000000000B5-0000000000000000000000000000000000000000
+0000000100000000000000B6-0000000000000000000000000000000000000000.gz
+0000000100000000000000B7-0000000000000000000000000000000000000000
+0000000100000000000000B8-0000000000000000000000000000000000000000.gz
+0000000100000000000000B9-0000000000000000000000000000000000000000
+0000000100000000000000BA-0000000000000000000000000000000000000000.gz
+0000000100000000000000BB-0000000000000000000000000000000000000000
+0000000100000000000000BC-0000000000000000000000000000000000000000.gz
+0000000100000000000000BD-0000000000000000000000000000000000000000
+0000000100000000000000BE-0000000000000000000000000000000000000000.gz
+0000000100000000000000BF-0000000000000000000000000000000000000000
+0000000100000000000000C0-0000000000000000000000000000000000000000.gz
+0000000100000000000000C1-0000000000000000000000000000000000000000
+0000000100000000000000C2-0000000000000000000000000000000000000000.gz
+0000000100000000000000C3-0000000000000000000000000000000000000000
+0000000100000000000000C4-0000000000000000000000000000000000000000.gz
+0000000100000000000000C5-0000000000000000000000000000000000000000
+0000000100000000000000C6-0000000000000000000000000000000000000000.gz
+0000000100000000000000C7-0000000000000000000000000000000000000000
+0000000100000000000000C8-0000000000000000000000000000000000000000.gz
+0000000100000000000000C9-0000000000000000000000000000000000000000
+0000000100000000000000CA-0000000000000000000000000000000000000000.gz
+0000000100000000000000CB-0000000000000000000000000000000000000000
+0000000100000000000000CC-0000000000000000000000000000000000000000.gz
+0000000100000000000000CD-0000000000000000000000000000000000000000
+0000000100000000000000CE-0000000000000000000000000000000000000000.gz
+0000000100000000000000CF-0000000000000000000000000000000000000000
+0000000100000000000000D0-0000000000000000000000000000000000000000.gz
+0000000100000000000000D1-0000000000000000000000000000000000000000
+0000000100000000000000D2-0000000000000000000000000000000000000000.gz
+0000000100000000000000D3-0000000000000000000000000000000000000000
+0000000100000000000000D4-0000000000000000000000000000000000000000.gz
+0000000100000000000000D5-0000000000000000000000000000000000000000
+0000000100000000000000D6-0000000000000000000000000000000000000000.gz
+0000000100000000000000D7-0000000000000000000000000000000000000000
+0000000100000000000000D8-0000000000000000000000000000000000000000.gz
+0000000100000000000000D9-0000000000000000000000000000000000000000
+0000000100000000000000DA-0000000000000000000000000000000000000000.gz
+0000000100000000000000DB-0000000000000000000000000000000000000000
+0000000100000000000000DC-0000000000000000000000000000000000000000.gz
+0000000100000000000000DD-0000000000000000000000000000000000000000
+0000000100000000000000DE-0000000000000000000000000000000000000000.gz
+0000000100000000000000DF-0000000000000000000000000000000000000000
+0000000100000000000000E0-0000000000000000000000000000000000000000.gz
+0000000100000000000000E1-0000000000000000000000000000000000000000
+0000000100000000000000E2-0000000000000000000000000000000000000000.gz
+0000000100000000000000E3-0000000000000000000000000000000000000000
+0000000100000000000000E4-0000000000000000000000000000000000000000.gz
+0000000100000000000000E5-0000000000000000000000000000000000000000
+0000000100000000000000E6-0000000000000000000000000000000000000000.gz
+0000000100000000000000E7-0000000000000000000000000000000000000000
+0000000100000000000000E8-0000000000000000000000000000000000000000.gz
+0000000100000000000000E9-0000000000000000000000000000000000000000
+0000000100000000000000EA-0000000000000000000000000000000000000000.gz
+0000000100000000000000EB-0000000000000000000000000000000000000000
+0000000100000000000000EC-0000000000000000000000000000000000000000.gz
+0000000100000000000000ED-0000000000000000000000000000000000000000
+0000000100000000000000EE-0000000000000000000000000000000000000000.gz
+0000000100000000000000EF-0000000000000000000000000000000000000000
+0000000100000000000000F0-0000000000000000000000000000000000000000.gz
+0000000100000000000000F1-0000000000000000000000000000000000000000
+0000000100000000000000F2-0000000000000000000000000000000000000000.gz
+0000000100000000000000F3-0000000000000000000000000000000000000000
+0000000100000000000000F4-0000000000000000000000000000000000000000.gz
+0000000100000000000000F5-0000000000000000000000000000000000000000
+0000000100000000000000F6-0000000000000000000000000000000000000000.gz
+0000000100000000000000F7-0000000000000000000000000000000000000000
+0000000100000000000000F8-0000000000000000000000000000000000000000.gz
+0000000100000000000000F9-0000000000000000000000000000000000000000
+0000000100000000000000FA-0000000000000000000000000000000000000000.gz
+0000000100000000000000FB-0000000000000000000000000000000000000000
+0000000100000000000000FC-0000000000000000000000000000000000000000.gz
+0000000100000000000000FD-0000000000000000000000000000000000000000
+0000000100000000000000FE-0000000000000000000000000000000000000000.gz
+0000000100000000000000FF-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000001:
+000000010000000100000000-0000000000000000000000000000000000000000
+000000010000000100000001-0000000000000000000000000000000000000000.gz
+000000010000000100000002-0000000000000000000000000000000000000000.gz
+000000010000000100000003-0000000000000000000000000000000000000000
+000000010000000100000004-0000000000000000000000000000000000000000.gz
+000000010000000100000005-0000000000000000000000000000000000000000.gz
+000000010000000100000006-0000000000000000000000000000000000000000
+000000010000000100000007-0000000000000000000000000000000000000000.gz
+000000010000000100000008-0000000000000000000000000000000000000000.gz
+000000010000000100000009-0000000000000000000000000000000000000000
+00000001000000010000000A-0000000000000000000000000000000000000000.gz
+
+* full backup: label = [BACKUP-FULL-5], start = 000000010000000000000000, stop = 000000010000000000000002
+====================================================================================================================================
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"00000001000000000000000C","backup-archive-stop":"00000001000000000000000E","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":1,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-3]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-INCR-2]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"0000000100000000000000FB","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-3]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"incr","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"0000000100000000000000FF","backup-archive-stop":"000000010000000100000001","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-DIFF-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000100000005","backup-archive-stop":"000000010000000100000007","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-4]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-5]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":3,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201510051
+db-control-version=942
+db-id=3
+db-system-id=6392579261579036436
+db-version="9.5"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":6395542721432104958,"db-version":"9.3"}
+3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":6392579261579036436,"db-version":"9.5"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-2]
+[BACKUP-FULL-3]
+[BACKUP-INCR-2]
+[BACKUP-FULL-4]
+[BACKUP-DIFF-1]
+[BACKUP-FULL-5]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.2-1
+9.3-2
+9.5-3
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1:
+0000000100000000
+
+[TEST_PATH]/db-master/repo/archive/db/9.2-1/0000000100000000:
+00000001000000000000000C-0000000000000000000000000000000000000000.gz
+00000001000000000000000D-0000000000000000000000000000000000000000
+00000001000000000000000E-0000000000000000000000000000000000000000.gz
+00000001000000000000000F-0000000000000000000000000000000000000000.gz
+000000010000000000000010-0000000000000000000000000000000000000000
+000000010000000000000011-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2:
+0000000100000000
+0000000100000001
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000003-0000000000000000000000000000000000000000.gz
+000000010000000000000004-0000000000000000000000000000000000000000
+000000010000000000000005-0000000000000000000000000000000000000000.gz
+000000010000000000000006-0000000000000000000000000000000000000000.gz
+000000010000000000000007-0000000000000000000000000000000000000000
+000000010000000000000008-0000000000000000000000000000000000000000.gz
+000000010000000000000009-0000000000000000000000000000000000000000
+00000001000000000000000A-0000000000000000000000000000000000000000.gz
+00000001000000000000000B-0000000000000000000000000000000000000000
+00000001000000000000000C-0000000000000000000000000000000000000000.gz
+00000001000000000000000D-0000000000000000000000000000000000000000
+00000001000000000000000E-0000000000000000000000000000000000000000.gz
+00000001000000000000000F-0000000000000000000000000000000000000000
+000000010000000000000010-0000000000000000000000000000000000000000.gz
+000000010000000000000011-0000000000000000000000000000000000000000
+000000010000000000000012-0000000000000000000000000000000000000000.gz
+000000010000000000000013-0000000000000000000000000000000000000000
+000000010000000000000014-0000000000000000000000000000000000000000.gz
+000000010000000000000015-0000000000000000000000000000000000000000
+000000010000000000000016-0000000000000000000000000000000000000000.gz
+000000010000000000000017-0000000000000000000000000000000000000000
+000000010000000000000018-0000000000000000000000000000000000000000.gz
+000000010000000000000019-0000000000000000000000000000000000000000
+00000001000000000000001A-0000000000000000000000000000000000000000.gz
+00000001000000000000001B-0000000000000000000000000000000000000000
+00000001000000000000001C-0000000000000000000000000000000000000000.gz
+00000001000000000000001D-0000000000000000000000000000000000000000
+00000001000000000000001E-0000000000000000000000000000000000000000.gz
+00000001000000000000001F-0000000000000000000000000000000000000000
+000000010000000000000020-0000000000000000000000000000000000000000.gz
+000000010000000000000021-0000000000000000000000000000000000000000
+000000010000000000000022-0000000000000000000000000000000000000000.gz
+000000010000000000000023-0000000000000000000000000000000000000000
+000000010000000000000024-0000000000000000000000000000000000000000.gz
+000000010000000000000025-0000000000000000000000000000000000000000
+000000010000000000000026-0000000000000000000000000000000000000000.gz
+000000010000000000000027-0000000000000000000000000000000000000000
+000000010000000000000028-0000000000000000000000000000000000000000.gz
+000000010000000000000029-0000000000000000000000000000000000000000
+00000001000000000000002A-0000000000000000000000000000000000000000.gz
+00000001000000000000002B-0000000000000000000000000000000000000000
+00000001000000000000002C-0000000000000000000000000000000000000000.gz
+00000001000000000000002D-0000000000000000000000000000000000000000
+00000001000000000000002E-0000000000000000000000000000000000000000.gz
+00000001000000000000002F-0000000000000000000000000000000000000000
+000000010000000000000030-0000000000000000000000000000000000000000.gz
+000000010000000000000031-0000000000000000000000000000000000000000
+000000010000000000000032-0000000000000000000000000000000000000000.gz
+000000010000000000000033-0000000000000000000000000000000000000000
+000000010000000000000034-0000000000000000000000000000000000000000.gz
+000000010000000000000035-0000000000000000000000000000000000000000
+000000010000000000000036-0000000000000000000000000000000000000000.gz
+000000010000000000000037-0000000000000000000000000000000000000000
+000000010000000000000038-0000000000000000000000000000000000000000.gz
+000000010000000000000039-0000000000000000000000000000000000000000
+00000001000000000000003A-0000000000000000000000000000000000000000.gz
+00000001000000000000003B-0000000000000000000000000000000000000000
+00000001000000000000003C-0000000000000000000000000000000000000000.gz
+00000001000000000000003D-0000000000000000000000000000000000000000
+00000001000000000000003E-0000000000000000000000000000000000000000.gz
+00000001000000000000003F-0000000000000000000000000000000000000000
+000000010000000000000040-0000000000000000000000000000000000000000.gz
+000000010000000000000041-0000000000000000000000000000000000000000
+000000010000000000000042-0000000000000000000000000000000000000000.gz
+000000010000000000000043-0000000000000000000000000000000000000000
+000000010000000000000044-0000000000000000000000000000000000000000.gz
+000000010000000000000045-0000000000000000000000000000000000000000
+000000010000000000000046-0000000000000000000000000000000000000000.gz
+000000010000000000000047-0000000000000000000000000000000000000000
+000000010000000000000048-0000000000000000000000000000000000000000.gz
+000000010000000000000049-0000000000000000000000000000000000000000
+00000001000000000000004A-0000000000000000000000000000000000000000.gz
+00000001000000000000004B-0000000000000000000000000000000000000000
+00000001000000000000004C-0000000000000000000000000000000000000000.gz
+00000001000000000000004D-0000000000000000000000000000000000000000
+00000001000000000000004E-0000000000000000000000000000000000000000.gz
+00000001000000000000004F-0000000000000000000000000000000000000000
+000000010000000000000050-0000000000000000000000000000000000000000.gz
+000000010000000000000051-0000000000000000000000000000000000000000
+000000010000000000000052-0000000000000000000000000000000000000000.gz
+000000010000000000000053-0000000000000000000000000000000000000000
+000000010000000000000054-0000000000000000000000000000000000000000.gz
+000000010000000000000055-0000000000000000000000000000000000000000
+000000010000000000000056-0000000000000000000000000000000000000000.gz
+000000010000000000000057-0000000000000000000000000000000000000000
+000000010000000000000058-0000000000000000000000000000000000000000.gz
+000000010000000000000059-0000000000000000000000000000000000000000
+00000001000000000000005A-0000000000000000000000000000000000000000.gz
+00000001000000000000005B-0000000000000000000000000000000000000000
+00000001000000000000005C-0000000000000000000000000000000000000000.gz
+00000001000000000000005D-0000000000000000000000000000000000000000
+00000001000000000000005E-0000000000000000000000000000000000000000.gz
+00000001000000000000005F-0000000000000000000000000000000000000000
+000000010000000000000060-0000000000000000000000000000000000000000.gz
+000000010000000000000061-0000000000000000000000000000000000000000
+000000010000000000000062-0000000000000000000000000000000000000000.gz
+000000010000000000000063-0000000000000000000000000000000000000000
+000000010000000000000064-0000000000000000000000000000000000000000.gz
+000000010000000000000065-0000000000000000000000000000000000000000
+000000010000000000000066-0000000000000000000000000000000000000000.gz
+000000010000000000000067-0000000000000000000000000000000000000000
+000000010000000000000068-0000000000000000000000000000000000000000.gz
+000000010000000000000069-0000000000000000000000000000000000000000
+00000001000000000000006A-0000000000000000000000000000000000000000.gz
+00000001000000000000006B-0000000000000000000000000000000000000000
+00000001000000000000006C-0000000000000000000000000000000000000000.gz
+00000001000000000000006D-0000000000000000000000000000000000000000
+00000001000000000000006E-0000000000000000000000000000000000000000.gz
+00000001000000000000006F-0000000000000000000000000000000000000000
+000000010000000000000070-0000000000000000000000000000000000000000.gz
+000000010000000000000071-0000000000000000000000000000000000000000
+000000010000000000000072-0000000000000000000000000000000000000000.gz
+000000010000000000000073-0000000000000000000000000000000000000000
+000000010000000000000074-0000000000000000000000000000000000000000.gz
+000000010000000000000075-0000000000000000000000000000000000000000
+000000010000000000000076-0000000000000000000000000000000000000000.gz
+000000010000000000000077-0000000000000000000000000000000000000000
+000000010000000000000078-0000000000000000000000000000000000000000.gz
+000000010000000000000079-0000000000000000000000000000000000000000
+00000001000000000000007A-0000000000000000000000000000000000000000.gz
+00000001000000000000007B-0000000000000000000000000000000000000000
+00000001000000000000007C-0000000000000000000000000000000000000000.gz
+00000001000000000000007D-0000000000000000000000000000000000000000
+00000001000000000000007E-0000000000000000000000000000000000000000.gz
+00000001000000000000007F-0000000000000000000000000000000000000000
+000000010000000000000080-0000000000000000000000000000000000000000.gz
+000000010000000000000081-0000000000000000000000000000000000000000
+000000010000000000000082-0000000000000000000000000000000000000000.gz
+000000010000000000000083-0000000000000000000000000000000000000000
+000000010000000000000084-0000000000000000000000000000000000000000.gz
+000000010000000000000085-0000000000000000000000000000000000000000
+000000010000000000000086-0000000000000000000000000000000000000000.gz
+000000010000000000000087-0000000000000000000000000000000000000000
+000000010000000000000088-0000000000000000000000000000000000000000.gz
+000000010000000000000089-0000000000000000000000000000000000000000
+00000001000000000000008A-0000000000000000000000000000000000000000.gz
+00000001000000000000008B-0000000000000000000000000000000000000000
+00000001000000000000008C-0000000000000000000000000000000000000000.gz
+00000001000000000000008D-0000000000000000000000000000000000000000
+00000001000000000000008E-0000000000000000000000000000000000000000.gz
+00000001000000000000008F-0000000000000000000000000000000000000000
+000000010000000000000090-0000000000000000000000000000000000000000.gz
+000000010000000000000091-0000000000000000000000000000000000000000
+000000010000000000000092-0000000000000000000000000000000000000000.gz
+000000010000000000000093-0000000000000000000000000000000000000000
+000000010000000000000094-0000000000000000000000000000000000000000.gz
+000000010000000000000095-0000000000000000000000000000000000000000
+000000010000000000000096-0000000000000000000000000000000000000000.gz
+000000010000000000000097-0000000000000000000000000000000000000000
+000000010000000000000098-0000000000000000000000000000000000000000.gz
+000000010000000000000099-0000000000000000000000000000000000000000
+00000001000000000000009A-0000000000000000000000000000000000000000.gz
+00000001000000000000009B-0000000000000000000000000000000000000000
+00000001000000000000009C-0000000000000000000000000000000000000000.gz
+00000001000000000000009D-0000000000000000000000000000000000000000
+00000001000000000000009E-0000000000000000000000000000000000000000.gz
+00000001000000000000009F-0000000000000000000000000000000000000000
+0000000100000000000000A0-0000000000000000000000000000000000000000.gz
+0000000100000000000000A1-0000000000000000000000000000000000000000
+0000000100000000000000A2-0000000000000000000000000000000000000000.gz
+0000000100000000000000A3-0000000000000000000000000000000000000000
+0000000100000000000000A4-0000000000000000000000000000000000000000.gz
+0000000100000000000000A5-0000000000000000000000000000000000000000
+0000000100000000000000A6-0000000000000000000000000000000000000000.gz
+0000000100000000000000A7-0000000000000000000000000000000000000000
+0000000100000000000000A8-0000000000000000000000000000000000000000.gz
+0000000100000000000000A9-0000000000000000000000000000000000000000
+0000000100000000000000AA-0000000000000000000000000000000000000000.gz
+0000000100000000000000AB-0000000000000000000000000000000000000000
+0000000100000000000000AC-0000000000000000000000000000000000000000.gz
+0000000100000000000000AD-0000000000000000000000000000000000000000
+0000000100000000000000AE-0000000000000000000000000000000000000000.gz
+0000000100000000000000AF-0000000000000000000000000000000000000000
+0000000100000000000000B0-0000000000000000000000000000000000000000.gz
+0000000100000000000000B1-0000000000000000000000000000000000000000
+0000000100000000000000B2-0000000000000000000000000000000000000000.gz
+0000000100000000000000B3-0000000000000000000000000000000000000000
+0000000100000000000000B4-0000000000000000000000000000000000000000.gz
+0000000100000000000000B5-0000000000000000000000000000000000000000
+0000000100000000000000B6-0000000000000000000000000000000000000000.gz
+0000000100000000000000B7-0000000000000000000000000000000000000000
+0000000100000000000000B8-0000000000000000000000000000000000000000.gz
+0000000100000000000000B9-0000000000000000000000000000000000000000
+0000000100000000000000BA-0000000000000000000000000000000000000000.gz
+0000000100000000000000BB-0000000000000000000000000000000000000000
+0000000100000000000000BC-0000000000000000000000000000000000000000.gz
+0000000100000000000000BD-0000000000000000000000000000000000000000
+0000000100000000000000BE-0000000000000000000000000000000000000000.gz
+0000000100000000000000BF-0000000000000000000000000000000000000000
+0000000100000000000000C0-0000000000000000000000000000000000000000.gz
+0000000100000000000000C1-0000000000000000000000000000000000000000
+0000000100000000000000C2-0000000000000000000000000000000000000000.gz
+0000000100000000000000C3-0000000000000000000000000000000000000000
+0000000100000000000000C4-0000000000000000000000000000000000000000.gz
+0000000100000000000000C5-0000000000000000000000000000000000000000
+0000000100000000000000C6-0000000000000000000000000000000000000000.gz
+0000000100000000000000C7-0000000000000000000000000000000000000000
+0000000100000000000000C8-0000000000000000000000000000000000000000.gz
+0000000100000000000000C9-0000000000000000000000000000000000000000
+0000000100000000000000CA-0000000000000000000000000000000000000000.gz
+0000000100000000000000CB-0000000000000000000000000000000000000000
+0000000100000000000000CC-0000000000000000000000000000000000000000.gz
+0000000100000000000000CD-0000000000000000000000000000000000000000
+0000000100000000000000CE-0000000000000000000000000000000000000000.gz
+0000000100000000000000CF-0000000000000000000000000000000000000000
+0000000100000000000000D0-0000000000000000000000000000000000000000.gz
+0000000100000000000000D1-0000000000000000000000000000000000000000
+0000000100000000000000D2-0000000000000000000000000000000000000000.gz
+0000000100000000000000D3-0000000000000000000000000000000000000000
+0000000100000000000000D4-0000000000000000000000000000000000000000.gz
+0000000100000000000000D5-0000000000000000000000000000000000000000
+0000000100000000000000D6-0000000000000000000000000000000000000000.gz
+0000000100000000000000D7-0000000000000000000000000000000000000000
+0000000100000000000000D8-0000000000000000000000000000000000000000.gz
+0000000100000000000000D9-0000000000000000000000000000000000000000
+0000000100000000000000DA-0000000000000000000000000000000000000000.gz
+0000000100000000000000DB-0000000000000000000000000000000000000000
+0000000100000000000000DC-0000000000000000000000000000000000000000.gz
+0000000100000000000000DD-0000000000000000000000000000000000000000
+0000000100000000000000DE-0000000000000000000000000000000000000000.gz
+0000000100000000000000DF-0000000000000000000000000000000000000000
+0000000100000000000000E0-0000000000000000000000000000000000000000.gz
+0000000100000000000000E1-0000000000000000000000000000000000000000
+0000000100000000000000E2-0000000000000000000000000000000000000000.gz
+0000000100000000000000E3-0000000000000000000000000000000000000000
+0000000100000000000000E4-0000000000000000000000000000000000000000.gz
+0000000100000000000000E5-0000000000000000000000000000000000000000
+0000000100000000000000E6-0000000000000000000000000000000000000000.gz
+0000000100000000000000E7-0000000000000000000000000000000000000000
+0000000100000000000000E8-0000000000000000000000000000000000000000.gz
+0000000100000000000000E9-0000000000000000000000000000000000000000
+0000000100000000000000EA-0000000000000000000000000000000000000000.gz
+0000000100000000000000EB-0000000000000000000000000000000000000000
+0000000100000000000000EC-0000000000000000000000000000000000000000.gz
+0000000100000000000000ED-0000000000000000000000000000000000000000
+0000000100000000000000EE-0000000000000000000000000000000000000000.gz
+0000000100000000000000EF-0000000000000000000000000000000000000000
+0000000100000000000000F0-0000000000000000000000000000000000000000.gz
+0000000100000000000000F1-0000000000000000000000000000000000000000
+0000000100000000000000F2-0000000000000000000000000000000000000000.gz
+0000000100000000000000F3-0000000000000000000000000000000000000000
+0000000100000000000000F4-0000000000000000000000000000000000000000.gz
+0000000100000000000000F5-0000000000000000000000000000000000000000
+0000000100000000000000F6-0000000000000000000000000000000000000000.gz
+0000000100000000000000F7-0000000000000000000000000000000000000000
+0000000100000000000000F8-0000000000000000000000000000000000000000.gz
+0000000100000000000000F9-0000000000000000000000000000000000000000
+0000000100000000000000FA-0000000000000000000000000000000000000000.gz
+0000000100000000000000FB-0000000000000000000000000000000000000000
+0000000100000000000000FC-0000000000000000000000000000000000000000.gz
+0000000100000000000000FD-0000000000000000000000000000000000000000
+0000000100000000000000FE-0000000000000000000000000000000000000000.gz
+0000000100000000000000FF-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000001:
+000000010000000100000000-0000000000000000000000000000000000000000
+000000010000000100000001-0000000000000000000000000000000000000000.gz
+000000010000000100000002-0000000000000000000000000000000000000000.gz
+000000010000000100000003-0000000000000000000000000000000000000000
+000000010000000100000004-0000000000000000000000000000000000000000.gz
+000000010000000100000005-0000000000000000000000000000000000000000.gz
+000000010000000100000006-0000000000000000000000000000000000000000
+000000010000000100000007-0000000000000000000000000000000000000000.gz
+000000010000000100000008-0000000000000000000000000000000000000000.gz
+000000010000000100000009-0000000000000000000000000000000000000000
+00000001000000010000000A-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.5-3:
+0000000100000000
+
+[TEST_PATH]/db-master/repo/archive/db/9.5-3/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000003-0000000000000000000000000000000000000000.gz
+000000010000000000000004-0000000000000000000000000000000000000000
+000000010000000000000005-0000000000000000000000000000000000000000.gz
+
+Upgrade the stanza, create full back - earliest db orphaned archive removed and earliest full backup and archive in previous db version removed
+> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config="[TEST_PATH]/db-master/pgbackrest.conf" --stanza=db --log-level-console=detail --retention-full=2 --retention-archive-type=full expire
+------------------------------------------------------------------------------------------------------------------------------------
+P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-master/pgbackrest.conf --lock-path=[TEST_PATH]/db-master/repo/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/repo/log --repo-path=[TEST_PATH]/db-master/repo --retention-archive-type=full --retention-full=2 --stanza=db
+P00 INFO: expire full backup [BACKUP-FULL-2]
+P00 INFO: expire full backup set: [BACKUP-FULL-3], [BACKUP-INCR-2]
+P00 INFO: remove expired backup [BACKUP-INCR-2]
+P00 INFO: remove expired backup [BACKUP-FULL-3]
+P00 INFO: remove expired backup [BACKUP-FULL-2]
+P00 INFO: removed orphaned archive path: [TEST_PATH]/db-master/repo/archive/db/9.2-1
+P00 DETAIL: archive retention on backup [BACKUP-FULL-4], archiveId = 9.3-2, start = 0000000100000000000000FF
+P00 DETAIL: remove archive: start = 000000010000000000000000, stop = 0000000100000000000000FE
+P00 DETAIL: archive retention on backup [BACKUP-FULL-5], archiveId = 9.5-3, start = 000000010000000000000000
+P00 INFO: expire command end: completed successfully
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"0000000100000000000000FF","backup-archive-stop":"000000010000000100000001","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-DIFF-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000100000005","backup-archive-stop":"000000010000000100000007","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-4]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-5]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":3,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201510051
+db-control-version=942
+db-id=3
+db-system-id=6392579261579036436
+db-version="9.5"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":6395542721432104958,"db-version":"9.3"}
+3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":6392579261579036436,"db-version":"9.5"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-4]
+[BACKUP-DIFF-1]
+[BACKUP-FULL-5]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.3-2
+9.5-3
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2:
+0000000100000000
+0000000100000001
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000:
+0000000100000000000000FF-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000001:
+000000010000000100000000-0000000000000000000000000000000000000000
+000000010000000100000001-0000000000000000000000000000000000000000.gz
+000000010000000100000002-0000000000000000000000000000000000000000.gz
+000000010000000100000003-0000000000000000000000000000000000000000
+000000010000000100000004-0000000000000000000000000000000000000000.gz
+000000010000000100000005-0000000000000000000000000000000000000000.gz
+000000010000000100000006-0000000000000000000000000000000000000000
+000000010000000100000007-0000000000000000000000000000000000000000.gz
+000000010000000100000008-0000000000000000000000000000000000000000.gz
+000000010000000100000009-0000000000000000000000000000000000000000
+00000001000000010000000A-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.5-3:
+0000000100000000
+
+[TEST_PATH]/db-master/repo/archive/db/9.5-3/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000003-0000000000000000000000000000000000000000.gz
+000000010000000000000004-0000000000000000000000000000000000000000
+000000010000000000000005-0000000000000000000000000000000000000000.gz
+
+* full backup: label = [BACKUP-FULL-6], start = 000000010000000000000006, stop = 000000010000000000000008
+====================================================================================================================================
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"0000000100000000000000FF","backup-archive-stop":"000000010000000100000001","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-DIFF-1]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000100000005","backup-archive-stop":"000000010000000100000007","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-prior":"[BACKUP-FULL-4]","backup-reference":[],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"diff","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-5]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":3,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-6]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"000000010000000000000008","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":3,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201510051
+db-control-version=942
+db-id=3
+db-system-id=6392579261579036436
+db-version="9.5"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":6395542721432104958,"db-version":"9.3"}
+3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":6392579261579036436,"db-version":"9.5"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-4]
+[BACKUP-DIFF-1]
+[BACKUP-FULL-5]
+[BACKUP-FULL-6]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.3-2
+9.5-3
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2:
+0000000100000000
+0000000100000001
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000:
+0000000100000000000000FF-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000001:
+000000010000000100000000-0000000000000000000000000000000000000000
+000000010000000100000001-0000000000000000000000000000000000000000.gz
+000000010000000100000002-0000000000000000000000000000000000000000.gz
+000000010000000100000003-0000000000000000000000000000000000000000
+000000010000000100000004-0000000000000000000000000000000000000000.gz
+000000010000000100000005-0000000000000000000000000000000000000000.gz
+000000010000000100000006-0000000000000000000000000000000000000000
+000000010000000100000007-0000000000000000000000000000000000000000.gz
+000000010000000100000008-0000000000000000000000000000000000000000.gz
+000000010000000100000009-0000000000000000000000000000000000000000
+00000001000000010000000A-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.5-3:
+0000000100000000
+
+[TEST_PATH]/db-master/repo/archive/db/9.5-3/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000003-0000000000000000000000000000000000000000.gz
+000000010000000000000004-0000000000000000000000000000000000000000
+000000010000000000000005-0000000000000000000000000000000000000000.gz
+000000010000000000000006-0000000000000000000000000000000000000000.gz
+000000010000000000000007-0000000000000000000000000000000000000000
+000000010000000000000008-0000000000000000000000000000000000000000.gz
+000000010000000000000009-0000000000000000000000000000000000000000.gz
+00000001000000000000000A-0000000000000000000000000000000000000000
+00000001000000000000000B-0000000000000000000000000000000000000000.gz
+
+Expire all archive last full backup through pitr
+> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config="[TEST_PATH]/db-master/pgbackrest.conf" --stanza=db --log-level-console=detail --retention-full=3 --retention-diff=1 --retention-archive-type=diff --retention-archive=1 expire
+------------------------------------------------------------------------------------------------------------------------------------
+P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-master/pgbackrest.conf --lock-path=[TEST_PATH]/db-master/repo/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/repo/log --repo-path=[TEST_PATH]/db-master/repo --retention-archive=1 --retention-archive-type=diff --retention-diff=1 --retention-full=3 --stanza=db
+P00 INFO: expire diff backup [BACKUP-DIFF-1]
+P00 INFO: remove expired backup [BACKUP-DIFF-1]
+P00 DETAIL: archive retention on backup [BACKUP-FULL-4], archiveId = 9.3-2, start = 0000000100000000000000FF
+P00 DETAIL: no archive to remove
+P00 DETAIL: archive retention on backup [BACKUP-FULL-5], archiveId = 9.5-3, start = 000000010000000000000000, stop = 000000010000000000000002
+P00 DETAIL: archive retention on backup [BACKUP-FULL-6], archiveId = 9.5-3, start = 000000010000000000000006
+P00 DETAIL: remove archive: start = 000000010000000000000003, stop = 000000010000000000000005
+P00 INFO: expire command end: completed successfully
+
++ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
+---------------------------------------------------------------------
+[backrest]
+backrest-checksum="[CHECKSUM]"
+backrest-format=5
+backrest-version="[VERSION-1]"
+
+[backup:current]
+[BACKUP-FULL-4]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"0000000100000000000000FF","backup-archive-stop":"000000010000000100000001","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":2,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-5]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000000","backup-archive-stop":"000000010000000000000002","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":3,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+[BACKUP-FULL-6]={"backrest-format":5,"backrest-version":"[VERSION-1]","backup-archive-start":"000000010000000000000006","backup-archive-stop":"000000010000000000000008","backup-info-repo-size":[SIZE],"backup-info-repo-size-delta":[DELTA],"backup-info-size":[SIZE],"backup-info-size-delta":[DELTA],"backup-timestamp-start":[TIMESTAMP],"backup-timestamp-stop":[TIMESTAMP],"backup-type":"full","db-id":3,"option-archive-check":true,"option-archive-copy":false,"option-backup-standby":false,"option-checksum-page":true,"option-compress":true,"option-hardlink":false,"option-online":true}
+
+[db]
+db-catalog-version=201510051
+db-control-version=942
+db-id=3
+db-system-id=6392579261579036436
+db-version="9.5"
+
+[db:history]
+1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":6393320793115174899,"db-version":"9.2"}
+2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":6395542721432104958,"db-version":"9.3"}
+3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":6392579261579036436,"db-version":"9.5"}
+
+> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
+------------------------------------------------------------------------------------------------------------------------------------
+[BACKUP-FULL-4]
+[BACKUP-FULL-5]
+[BACKUP-FULL-6]
+
+> ls -R [TEST_PATH]/db-master/repo/archive/db | grep -v "archive.info"
+------------------------------------------------------------------------------------------------------------------------------------
+[TEST_PATH]/db-master/repo/archive/db:
+9.3-2
+9.5-3
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2:
+0000000100000000
+0000000100000001
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000:
+0000000100000000000000FF-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000001:
+000000010000000100000000-0000000000000000000000000000000000000000
+000000010000000100000001-0000000000000000000000000000000000000000.gz
+000000010000000100000002-0000000000000000000000000000000000000000.gz
+000000010000000100000003-0000000000000000000000000000000000000000
+000000010000000100000004-0000000000000000000000000000000000000000.gz
+000000010000000100000005-0000000000000000000000000000000000000000.gz
+000000010000000100000006-0000000000000000000000000000000000000000
+000000010000000100000007-0000000000000000000000000000000000000000.gz
+000000010000000100000008-0000000000000000000000000000000000000000.gz
+000000010000000100000009-0000000000000000000000000000000000000000
+00000001000000010000000A-0000000000000000000000000000000000000000.gz
+
+[TEST_PATH]/db-master/repo/archive/db/9.5-3:
+0000000100000000
+
+[TEST_PATH]/db-master/repo/archive/db/9.5-3/0000000100000000:
+000000010000000000000000-0000000000000000000000000000000000000000.gz
+000000010000000000000001-0000000000000000000000000000000000000000
+000000010000000000000002-0000000000000000000000000000000000000000.gz
+000000010000000000000006-0000000000000000000000000000000000000000.gz
+000000010000000000000007-0000000000000000000000000000000000000000
+000000010000000000000008-0000000000000000000000000000000000000000.gz
+000000010000000000000009-0000000000000000000000000000000000000000.gz
+00000001000000000000000A-0000000000000000000000000000000000000000
+00000001000000000000000B-0000000000000000000000000000000000000000.gz
diff --git a/test/expect/full-real-001.log b/test/expect/full-real-001.log
index 81636de87..1ffe405c1 100644
--- a/test/expect/full-real-001.log
+++ b/test/expect/full-real-001.log
@@ -85,12 +85,16 @@ stanza-create db - verify success with force (db-master host)
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --log-level-console=detail --force stanza-create
------------------------------------------------------------------------------------------------------------------------------------
-stanza-create db - test force fails on database mismatch with directory (db-master host)
-> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --log-level-console=detail --no-online --force stanza-create
+stanza-create db - fail on database mismatch with directory (db-master host)
+> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --log-level-console=detail --db-path=[TEST_PATH]/db-master/db/testbase/ stanza-create
------------------------------------------------------------------------------------------------------------------------------------
-stanza-create db - restore stanza files (db-master host)
-> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --log-level-console=detail --no-online --force stanza-create
+stanza-create db - successfully create stanza files to be upgraded (db-master host)
+> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --log-level-console=detail --db-path=[TEST_PATH]/db-master/db/testbase/ --no-online --force stanza-create
+------------------------------------------------------------------------------------------------------------------------------------
+
+stanza-upgrade db - upgrade stanza files online (db-master host)
+> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --log-level-console=detail stanza-upgrade
------------------------------------------------------------------------------------------------------------------------------------
full backup - fail on backup lock exists (db-master host)
diff --git a/test/expect/full-real-007.log b/test/expect/full-real-007.log
index b64667de3..eb90384ba 100644
--- a/test/expect/full-real-007.log
+++ b/test/expect/full-real-007.log
@@ -136,12 +136,16 @@ stanza-create db - verify success with force (backup host)
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --log-level-console=detail --force stanza-create
------------------------------------------------------------------------------------------------------------------------------------
-stanza-create db - test force fails on database mismatch with directory (backup host)
-> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --log-level-console=detail --no-online --force stanza-create
+stanza-create db - fail on database mismatch with directory (backup host)
+> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --log-level-console=detail --db-path=[TEST_PATH]/db-master/db/testbase/ stanza-create
------------------------------------------------------------------------------------------------------------------------------------
-stanza-create db - restore stanza files (backup host)
-> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --log-level-console=detail --no-online --force stanza-create
+stanza-create db - successfully create stanza files to be upgraded (backup host)
+> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --log-level-console=detail --db-path=[TEST_PATH]/db-master/db/testbase/ --no-online --force stanza-create
+------------------------------------------------------------------------------------------------------------------------------------
+
+stanza-upgrade db - upgrade stanza files online (backup host)
+> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --log-level-console=detail stanza-upgrade
------------------------------------------------------------------------------------------------------------------------------------
full backup - fail on backup lock exists (backup host)
diff --git a/test/expect/full-synthetic-001.log b/test/expect/full-synthetic-001.log
index 7c695ff15..8e7ecaf25 100644
--- a/test/expect/full-synthetic-001.log
+++ b/test/expect/full-synthetic-001.log
@@ -80,7 +80,7 @@ P00 DEBUG: Protocol::Protocol::protocolGet: create local protocol
P00 DEBUG: File->new(): oProtocol = [object], strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRepoPath = [TEST_PATH]/db-master/repo, strStanza = db
P00 DEBUG: File->pathCreate(): bCreateParents = true, bIgnoreExists = true, strMode = <0750>, strPath = backup.history, strPathType = backup:cluster
P00 DEBUG: BackupInfo->new(): bRequired =