mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-01-30 05:39:12 +02:00
Closed #93: The retention-archive
option can now be be safely set to less than backup retention (retention-full
or retention-diff
) without also specifying archive-copy=n
. The WAL required to make the backups that fall outside of archive retention consistent will be preserved in the archive. However, in this case PITR will still not be possible for backups that fall outside of archive retention.
This commit is contained in:
parent
904a8c956f
commit
2d38876bc4
@ -5,7 +5,9 @@ __No Release Date Set__
|
||||
|
||||
* Fixed an issue where specifying `--no-archive-check` would throw a configuration error. _Reported by Jason O'Donnell_.
|
||||
|
||||
* Generate an error when `archive-check=y` but `archive_command` does not execute `pg_backrest`. _Contributed by Jason O'Donnell_
|
||||
* The `retention-archive` option can now be be safely set to less than backup retention (`retention-full` or `retention-diff`) without also specifying `archive-copy=n`. The WAL required to make the backups that fall outside of archive retention consistent will be preserved in the archive. However, in this case PITR will still not be possible for the backups that fall outside of archive retention.
|
||||
|
||||
* Generate an error when `archive-check=y` but `archive_command` does not execute `pg_backrest`. _Contributed by Jason O'Donnell_.
|
||||
|
||||
* Support for PostgreSQL 9.5 partial WAL segments and `recovery_target_action` setting. The `archive_mode = 'always'` setting is not yet supported.
|
||||
|
||||
|
@ -12,7 +12,10 @@
|
||||
<text>Fixed an issue where specifying <setting>--no-archive-check</setting> would throw a configuration error. <i>Reported by Jason O'Donnell</i>.</text>
|
||||
</release-feature>
|
||||
<release-feature>
|
||||
<text>Generate an error when <setting>archive-check=y</setting> but <setting>archive_command</setting> does not execute <file>pg_backrest</file>. <i>Contributed by Jason O'Donnell</i></text>
|
||||
<text>The <setting>retention-archive</setting> option can now be be safely set to less than backup retention (<setting>retention-full</setting> or <setting>retention-diff</setting>) without also specifying <setting>archive-copy=n</setting>. The WAL required to make the backups that fall outside of archive retention consistent will be preserved in the archive. However, in this case PITR will still not be possible for the backups that fall outside of archive retention.</text>
|
||||
</release-feature>
|
||||
<release-feature>
|
||||
<text>Generate an error when <setting>archive-check=y</setting> but <setting>archive_command</setting> does not execute <file>pg_backrest</file>. <i>Contributed by Jason O'Donnell</i>.</text>
|
||||
</release-feature>
|
||||
<release-feature>
|
||||
<text>Support for <postgres/> 9.5 partial WAL segments and <setting>recovery_target_action</setting> setting. The <setting>archive_mode = 'always'</setting> setting is not yet supported.</text>
|
||||
|
@ -345,7 +345,7 @@
|
||||
<config-key id="retention-diff" name="Differential Retention">
|
||||
<summary>Number of differential backups to retain.</summary>
|
||||
|
||||
<text>When a differential backup expires, all incremental backups associated with the differential backup will also expire. When not defined all differential backups will be kept.</text>
|
||||
<text>When a differential backup expires, all incremental backups associated with the differential backup will also expire. When not defined all differential backups will be kept until the full backups they depend on expire.</text>
|
||||
|
||||
<example>3</example>
|
||||
</config-key>
|
||||
@ -354,9 +354,7 @@
|
||||
<config-key id="retention-archive-type" name="Archive Retention Type">
|
||||
<summary>Backup type for WAL retention.</summary>
|
||||
|
||||
<text>If set to full, then <backrest/> will keep archive logs for the number of full backups defined by <setting>retention-archive</setting>. If set to diff (differential), then <backrest/> will keep archive logs for the number of differential backups defined by <setting>retention-archive</setting>.
|
||||
|
||||
If not defined then archive logs will be kept indefinitely. In general it is not useful to keep archive logs that are older than the oldest backup but there may occasionally be reasons for doing so.</text>
|
||||
<text>If set to <setting>full</setting> <backrest/> will keep archive logs for the number of full backups defined by <setting>retention-archive</setting>. If set to <setting>diff</setting> (differential) <backrest/> will keep archive logs for the number of full and differential backups defined by <setting>retention-archive</setting>. If set to <setting>incr</setting> (incremental) <backrest/> will keep archive logs for the number of full, differential, and incremental backups defined by <setting>retention-archive</setting>.</text>
|
||||
|
||||
<example>diff</example>
|
||||
</config-key>
|
||||
@ -365,9 +363,7 @@
|
||||
<config-key id="retention-archive" name="Archive Retention">
|
||||
<summary>Number of backups worth of WAL to retain.</summary>
|
||||
|
||||
<text>Number of backups worth of archive log to keep. If this is set less than your backup retention then be sure you set <setting>archive-copy=y</setting> or you won't be able to restore some older backups.
|
||||
|
||||
For example, if <setting>retention-archive=2</setting> and <setting>retention-full=4</setting>, then any backups older than the most recent two full backups will not have WAL segments in the archive to make them consistent. To solve this, set <setting>archive-copy=y</setting> and use <setting>type=none</setting> when restoring. This issue will be addressed in a future release but for now be careful with this setting.</text>
|
||||
<text>Number of backups worth of archive log to keep.</text>
|
||||
|
||||
<example>2</example>
|
||||
</config-key>
|
||||
|
@ -427,12 +427,14 @@ sub list
|
||||
my
|
||||
(
|
||||
$strOperation,
|
||||
$strFilter
|
||||
$strFilter,
|
||||
$strOrder
|
||||
) =
|
||||
logDebugParam
|
||||
(
|
||||
OP_INFO_BACKUP_LIST, \@_,
|
||||
{name => 'strFilter'}
|
||||
{name => 'strFilter', required => false},
|
||||
{name => 'strOrder', default => 'forward'}
|
||||
);
|
||||
|
||||
# List of backups
|
||||
@ -441,9 +443,16 @@ sub list
|
||||
# Iterate through the backups and filter
|
||||
for my $strBackup ($self->keys(INFO_BACKUP_SECTION_BACKUP_CURRENT))
|
||||
{
|
||||
if ($strBackup =~ $strFilter)
|
||||
if (!defined($strFilter) || $strBackup =~ $strFilter)
|
||||
{
|
||||
push(@stryBackup, $strBackup)
|
||||
if ($strOrder eq 'reverse')
|
||||
{
|
||||
unshift(@stryBackup, $strBackup)
|
||||
}
|
||||
else
|
||||
{
|
||||
push(@stryBackup, $strBackup)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ my $oConfigHelpData =
|
||||
"removed.\n" .
|
||||
"\n" .
|
||||
"If this occurs then the archive log stream will be interrupted and PITR will not be possible past that point. " .
|
||||
"A ne backup will be required to regain full restore capability.\n" .
|
||||
"A new backup will be required to regain full restore capability.\n" .
|
||||
"\n" .
|
||||
"The purpose of this feature is to prevent the log volume from filling up at which point Postgres will stop " .
|
||||
"completely. Better to lose the backup than have PostgreSQL go down.\n" .
|
||||
@ -419,13 +419,7 @@ my $oConfigHelpData =
|
||||
summary =>
|
||||
"Number of backups worth of WAL to retain.",
|
||||
description =>
|
||||
"Number of backups worth of archive log to keep. If this is set less than your backup retention then be sure " .
|
||||
"you set archive-copy=y or you won't be able to restore some older backups.\n" .
|
||||
"\n" .
|
||||
"For example, if retention-archive=2 and retention-full=4, then any backups older than the most recent two full " .
|
||||
"backups will not have WAL segments in the archive to make them consistent. To solve this, set " .
|
||||
"archive-copy=y and use type=none when restoring. This issue will be addressed in a future release but for " .
|
||||
"now be careful with this setting."
|
||||
"Number of backups worth of archive log to keep."
|
||||
},
|
||||
|
||||
# RETENTION-ARCHIVE-TYPE Option Help
|
||||
@ -436,12 +430,10 @@ my $oConfigHelpData =
|
||||
summary =>
|
||||
"Backup type for WAL retention.",
|
||||
description =>
|
||||
"If set to full, then pgBackRest will keep archive logs for the number of full backups defined by " .
|
||||
"retention-archive. If set to diff (differential), then pgBackRest will keep archive logs for the number of " .
|
||||
"differential backups defined by retention-archive.\n" .
|
||||
"\n" .
|
||||
"If not defined then archive logs will be kept indefinitely. In general it is not useful to keep archive logs " .
|
||||
"that are older than the oldest backup but there may occasionally be reasons for doing so."
|
||||
"If set to full pgBackRest will keep archive logs for the number of full backups defined by retention-archive. " .
|
||||
"If set to diff (differential) pgBackRest will keep archive logs for the number of full and differential " .
|
||||
"backups defined by retention-archive. If set to incr (incremental) pgBackRest will keep archive logs for " .
|
||||
"the number of full, differential, and incremental backups defined by retention-archive."
|
||||
},
|
||||
|
||||
# RETENTION-DIFF Option Help
|
||||
@ -453,7 +445,7 @@ my $oConfigHelpData =
|
||||
"Number of differential backups to retain.",
|
||||
description =>
|
||||
"When a differential backup expires, all incremental backups associated with the differential backup will also " .
|
||||
"expire. When not defined all differential backups will be kept."
|
||||
"expire. When not defined all differential backups will be kept until the full backups they depend on expire."
|
||||
},
|
||||
|
||||
# RETENTION-FULL Option Help
|
||||
|
@ -14,8 +14,10 @@ use File::Path qw(remove_tree);
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
|
||||
use lib dirname($0);
|
||||
use BackRest::Common::Exception;
|
||||
use BackRest::Common::Log;
|
||||
use BackRest::BackupCommon;
|
||||
use BackRest::BackupInfo;
|
||||
use BackRest::Config::Config;
|
||||
use BackRest::File;
|
||||
use BackRest::Manifest;
|
||||
@ -52,6 +54,9 @@ sub new
|
||||
protocolGet()
|
||||
);
|
||||
|
||||
# Initialize total archive expired
|
||||
$self->{iArchiveExpireTotal} = 0;
|
||||
|
||||
# Return from function and log return values if any
|
||||
return logDebugReturn
|
||||
(
|
||||
@ -86,6 +91,42 @@ sub DESTROY
|
||||
);
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
# logExpire
|
||||
#
|
||||
# Tracks which archive logs have been removed and provides log messages when needed.
|
||||
####################################################################################################################################
|
||||
sub logExpire
|
||||
{
|
||||
my $self = shift;
|
||||
my $strArchiveFile = shift;
|
||||
|
||||
if (defined($strArchiveFile))
|
||||
{
|
||||
if (!defined($self->{strArchiveExpireStart}))
|
||||
{
|
||||
$self->{strArchiveExpireStart} = $strArchiveFile;
|
||||
$self->{strArchiveExpireStop} = $strArchiveFile;
|
||||
}
|
||||
else
|
||||
{
|
||||
$self->{strArchiveExpireStop} = $strArchiveFile;
|
||||
}
|
||||
|
||||
$self->{iArchiveExpireTotal}++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (defined($self->{strArchiveExpireStart}))
|
||||
{
|
||||
&log(INFO, 'remove archive: start = ' . substr($self->{strArchiveExpireStart}, 0, 24) .
|
||||
', stop = ' . substr($self->{strArchiveExpireStop}, 0, 24));
|
||||
}
|
||||
|
||||
undef($self->{strArchiveExpireStart});
|
||||
}
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
# process
|
||||
#
|
||||
@ -202,8 +243,8 @@ sub process
|
||||
{
|
||||
&log(INFO, "remove expired backup ${strBackup}");
|
||||
|
||||
system("rm -rf ${strBackupClusterPath}/${strBackup}") == 0
|
||||
or confess &log(ERROR, "unable to delete backup ${strBackup}");
|
||||
remove_tree("${strBackupClusterPath}/${strBackup}") > 0
|
||||
or confess &log(ERROR, "unable to remove backup ${strBackup}", ERROR_PATH_REMOVE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,30 +272,15 @@ sub process
|
||||
# Determine which backup type to use for archive retention (full, differential, incremental)
|
||||
if ($strArchiveRetentionType eq BACKUP_TYPE_FULL)
|
||||
{
|
||||
@stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(true), 'reverse');
|
||||
@stryPath = $oBackupInfo->list(backupRegExpGet(true), 'reverse');
|
||||
}
|
||||
elsif ($strArchiveRetentionType eq BACKUP_TYPE_DIFF)
|
||||
{
|
||||
@stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(true, true), 'reverse');
|
||||
@stryPath = $oBackupInfo->list(backupRegExpGet(true, true), 'reverse');
|
||||
}
|
||||
elsif ($strArchiveRetentionType eq BACKUP_TYPE_INCR)
|
||||
{
|
||||
@stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(true, true, true), 'reverse');
|
||||
}
|
||||
else
|
||||
{
|
||||
confess &log(ERROR, "unknown archive_retention_type '$strArchiveRetentionType'");
|
||||
}
|
||||
|
||||
# Make sure that iArchiveRetention is set and valid
|
||||
if (!defined($iArchiveRetention))
|
||||
{
|
||||
confess &log(ERROR, 'archive_retention must be set if archive_retention_type is set');
|
||||
}
|
||||
|
||||
if (!looks_like_number($iArchiveRetention) || $iArchiveRetention < 1)
|
||||
{
|
||||
confess &log(ERROR, 'archive_retention must be a number >= 1');
|
||||
@stryPath = $oBackupInfo->list(backupRegExpGet(true, true, true), 'reverse');
|
||||
}
|
||||
|
||||
# if no backups were found then preserve current archive logs - too soon to expire them
|
||||
@ -274,84 +300,129 @@ sub process
|
||||
}
|
||||
}
|
||||
|
||||
# If a backup has been selected for retention then continue
|
||||
if (defined($strArchiveRetentionBackup))
|
||||
{
|
||||
my $strArchiveExpireStart;
|
||||
my $strArchiveExpireStop;
|
||||
my $bRemove;
|
||||
|
||||
# Get the archive logs that need to be kept. To be cautious we will keep all the archive logs starting from this
|
||||
# backup even though they are also in the pg_xlog directory (since they have been copied more than once).
|
||||
my $oManifest = new BackRest::Manifest($oFile->pathGet(PATH_BACKUP_CLUSTER) .
|
||||
"/${strArchiveRetentionBackup}/backup.manifest");
|
||||
|
||||
if ($oManifest->test(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_ARCHIVE_START))
|
||||
# Only expire if the selected backup has archive info - backups performed with --no-start-stop 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))
|
||||
{
|
||||
my $strArchiveLast = $oManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_ARCHIVE_START);
|
||||
|
||||
&log(INFO, "archive retention from backup ${strArchiveRetentionBackup}, start = ${strArchiveLast}");
|
||||
|
||||
# Get archive info
|
||||
my $oArchive = new BackRest::Archive();
|
||||
my $strArchiveId = $oArchive->getCheck($oFile);
|
||||
|
||||
# Remove any archive directories or files that are out of date
|
||||
my $strArchiveExpireMax;
|
||||
|
||||
# Get archive ranges to preserve. Because archive retention can be less than total retention it is
|
||||
# important to preserve older archive that is required to make the older backups consistent even though
|
||||
# they cannot be played any further forward with PITR.
|
||||
my @oyArchiveRange;
|
||||
|
||||
foreach my $strBackup ($oBackupInfo->list())
|
||||
{
|
||||
if ($strBackup le $strArchiveRetentionBackup &&
|
||||
$oBackupInfo->test(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_ARCHIVE_START))
|
||||
{
|
||||
my $oArchiveRange = {};
|
||||
|
||||
$$oArchiveRange{start} = $oBackupInfo->get(INFO_BACKUP_SECTION_BACKUP_CURRENT,
|
||||
$strBackup, INFO_BACKUP_KEY_ARCHIVE_START);
|
||||
|
||||
if ($strBackup ne $strArchiveRetentionBackup)
|
||||
{
|
||||
$$oArchiveRange{stop} = $oBackupInfo->get(INFO_BACKUP_SECTION_BACKUP_CURRENT,
|
||||
$strBackup, INFO_BACKUP_KEY_ARCHIVE_STOP);
|
||||
}
|
||||
else
|
||||
{
|
||||
$strArchiveExpireMax = $$oArchiveRange{start};
|
||||
}
|
||||
|
||||
&log(INFO, "archive retention on backup ${strBackup}, start = $$oArchiveRange{start}" .
|
||||
(defined($$oArchiveRange{stop}) ? ", stop = $$oArchiveRange{stop}" : ''));
|
||||
|
||||
push(@oyArchiveRange, $oArchiveRange);
|
||||
}
|
||||
}
|
||||
|
||||
# Get all major archive paths (timeline and first 64 bits of LSN)
|
||||
foreach $strPath ($oFile->list(PATH_BACKUP_ARCHIVE, $strArchiveId, "^[0-F]{16}\$"))
|
||||
{
|
||||
logDebugMisc($strOperation, "found major WAL path: ${strPath}");
|
||||
$bRemove = true;
|
||||
|
||||
# If less than first 16 characters of current archive file, then remove the directory
|
||||
if ($strPath lt substr($strArchiveLast, 0, 16))
|
||||
# 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}");
|
||||
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}");
|
||||
|
||||
# Record expire start and stop location for info
|
||||
if (!defined($strArchiveExpireStart))
|
||||
{
|
||||
$strArchiveExpireStart = $strPath;
|
||||
}
|
||||
|
||||
$strArchiveExpireStop = $strPath;
|
||||
$self->logExpire($strPath);
|
||||
}
|
||||
# If equals the first 16 characters of the current archive file, then delete individual files instead
|
||||
elsif ($strPath eq substr($strArchiveLast, 0, 16))
|
||||
# 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))
|
||||
{
|
||||
my $strSubPath;
|
||||
|
||||
# Look for archive files in the archive directory
|
||||
foreach $strSubPath ($oFile->list(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strPath}", "^[0-F]{24}.*\$"))
|
||||
# Look for files in the archive directory
|
||||
foreach my $strSubPath ($oFile->list(PATH_BACKUP_ARCHIVE,
|
||||
"${strArchiveId}/${strPath}", "^[0-F]{24}.*\$"))
|
||||
{
|
||||
# Delete if the first 24 characters less than the current archive file
|
||||
if ($strSubPath lt substr($strArchiveLast, 0, 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)
|
||||
{
|
||||
unlink($oFile->pathGet(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strSubPath}"))
|
||||
or confess &log(ERROR, 'unable to remove ' . $strSubPath);
|
||||
or confess &log(ERROR, 'unable to remove ' . $strSubPath, ERROR_FILE_REMOVE);
|
||||
|
||||
logDebugMisc($strOperation, "remove expired WAL segment: ${strSubPath}");
|
||||
logDebugMisc($strOperation, "remove WAL segment: ${strSubPath}");
|
||||
|
||||
# Record expire start and stop location for info
|
||||
if (!defined($strArchiveExpireStart))
|
||||
{
|
||||
$strArchiveExpireStart = $strSubPath;
|
||||
}
|
||||
|
||||
$strArchiveExpireStop = $strSubPath;
|
||||
# Log expire info
|
||||
$self->logExpire(substr($strSubPath, 0, 24));
|
||||
}
|
||||
else
|
||||
{
|
||||
# Log that the file was not expired
|
||||
$self->logExpire();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!defined($strArchiveExpireStart))
|
||||
# Log if no archive was expired
|
||||
if ($self->{iArchiveExpireTotal} == 0)
|
||||
{
|
||||
&log(INFO, 'no WAL segments to expire');
|
||||
}
|
||||
else
|
||||
{
|
||||
&log(INFO, 'expire WAL segments: start = ' . substr($strArchiveExpireStart, 0, 24) .
|
||||
', stop = ' . substr($strArchiveExpireStop, 0, 24));
|
||||
&log(INFO, 'no archive to remove');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -763,14 +763,14 @@ sub BackRestTestBackup_Test
|
||||
$oExpireTest->process($strStanza, 1, 1, BACKUP_TYPE_FULL, 1, $strDescription);
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
$strDescription = 'Expire oldest diff backup';
|
||||
$strDescription = 'Expire oldest full backup';
|
||||
|
||||
$oExpireTest->backupCreate($strStanza, BACKUP_TYPE_DIFF, $lBaseTime += SECONDS_PER_DAY);
|
||||
$oExpireTest->backupCreate($strStanza, BACKUP_TYPE_DIFF, $lBaseTime += SECONDS_PER_DAY, 256);
|
||||
$oExpireTest->process($strStanza, 1, 1, BACKUP_TYPE_FULL, 1, $strDescription);
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
$strDescription = 'Expire oldest full backup, archive expire does not fall on major segment boundary';
|
||||
$strDescription = 'Expire oldest diff backup, archive expire does not fall on major segment boundary';
|
||||
|
||||
$oExpireTest->backupCreate($strStanza, BACKUP_TYPE_FULL, $lBaseTime += SECONDS_PER_DAY);
|
||||
$oExpireTest->backupCreate($strStanza, BACKUP_TYPE_DIFF, $lBaseTime += SECONDS_PER_DAY, undef, 0);
|
||||
|
@ -304,8 +304,8 @@ Nothing to expire
|
||||
> [BACKREST_BIN] "--config=[TEST_PATH]/backrest/pg_backrest.conf" --stanza=db --log-level-console=info --retention-full=1 --retention-diff=1 --retention-archive-type=full --retention-archive=1 expire
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
INFO: expire start: --no-compress --config=[TEST_PATH]/backrest/pg_backrest.conf --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --retention-archive=1 --retention-archive-type=full --retention-diff=1 --retention-full=1 --stanza=db
|
||||
INFO: archive retention from backup [BACKUP-FULL-1], start = 000000010000000000000000
|
||||
INFO: no WAL segments to expire
|
||||
INFO: archive retention on backup [BACKUP-FULL-1], start = 000000010000000000000000
|
||||
INFO: no archive to remove
|
||||
INFO: expire stop
|
||||
|
||||
+ supplemental file: [TEST_PATH]/backrest/backup/db/backup.info
|
||||
@ -920,8 +920,8 @@ Expire oldest full backup, archive expire falls on segment major boundary
|
||||
INFO: expire full backup set: [BACKUP-FULL-1], [BACKUP-INCR-1]
|
||||
INFO: remove expired backup [BACKUP-INCR-1]
|
||||
INFO: remove expired backup [BACKUP-FULL-1]
|
||||
INFO: archive retention from backup [BACKUP-FULL-2], start = 000000010000000100000000
|
||||
INFO: expire WAL segments: start = 0000000100000000, stop = 0000000100000000
|
||||
INFO: archive retention on backup [BACKUP-FULL-2], start = 000000010000000100000000
|
||||
INFO: remove archive: start = 0000000100000000, stop = 0000000100000000
|
||||
INFO: expire stop
|
||||
|
||||
+ supplemental file: [TEST_PATH]/backrest/backup/db/backup.info
|
||||
@ -1292,14 +1292,14 @@ db-version="9.2"
|
||||
00000001000000020000000E-0000000000000000000000000000000000000000
|
||||
00000001000000020000000F-0000000000000000000000000000000000000000.gz
|
||||
|
||||
Expire oldest diff backup
|
||||
Expire oldest full backup
|
||||
> [BACKREST_BIN] "--config=[TEST_PATH]/backrest/pg_backrest.conf" --stanza=db --log-level-console=info --retention-full=1 --retention-diff=1 --retention-archive-type=full --retention-archive=1 expire
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
INFO: expire start: --no-compress --config=[TEST_PATH]/backrest/pg_backrest.conf --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --retention-archive=1 --retention-archive-type=full --retention-diff=1 --retention-full=1 --stanza=db
|
||||
INFO: expire diff backup [BACKUP-DIFF-1]
|
||||
INFO: remove expired backup [BACKUP-DIFF-1]
|
||||
INFO: archive retention from backup [BACKUP-FULL-2], start = 000000010000000100000000
|
||||
INFO: no WAL segments to expire
|
||||
INFO: archive retention on backup [BACKUP-FULL-2], start = 000000010000000100000000
|
||||
INFO: no archive to remove
|
||||
INFO: expire stop
|
||||
|
||||
+ supplemental file: [TEST_PATH]/backrest/backup/db/backup.info
|
||||
@ -1964,15 +1964,17 @@ db-version="9.2"
|
||||
00000001000000020000001C-0000000000000000000000000000000000000000.gz
|
||||
00000001000000020000001D-0000000000000000000000000000000000000000.gz
|
||||
|
||||
Expire oldest full backup, archive expire does not fall on major segment boundary
|
||||
Expire oldest diff backup, archive expire does not fall on major segment boundary
|
||||
> [BACKREST_BIN] "--config=[TEST_PATH]/backrest/pg_backrest.conf" --stanza=db --log-level-console=info --retention-full=1 --retention-diff=1 --retention-archive-type=diff --retention-archive=1 expire
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
INFO: expire start: --no-compress --config=[TEST_PATH]/backrest/pg_backrest.conf --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --retention-archive=1 --retention-archive-type=diff --retention-diff=1 --retention-full=1 --stanza=db
|
||||
INFO: expire full backup set: [BACKUP-FULL-2], [BACKUP-DIFF-2]
|
||||
INFO: remove expired backup [BACKUP-DIFF-2]
|
||||
INFO: remove expired backup [BACKUP-FULL-2]
|
||||
INFO: archive retention from backup [BACKUP-DIFF-3], start = 000000010000000200000016
|
||||
INFO: expire WAL segments: start = 0000000100000001, stop = 000000010000000200000015
|
||||
INFO: archive retention on backup [BACKUP-FULL-3], start = 000000010000000200000010, stop = 000000010000000200000012
|
||||
INFO: archive retention on backup [BACKUP-DIFF-3], start = 000000010000000200000016
|
||||
INFO: remove archive: start = 0000000100000001, stop = 00000001000000020000000F
|
||||
INFO: remove archive: start = 000000010000000200000013, stop = 000000010000000200000015
|
||||
INFO: expire stop
|
||||
|
||||
+ supplemental file: [TEST_PATH]/backrest/backup/db/backup.info
|
||||
@ -2022,6 +2024,9 @@ db-version="9.2"
|
||||
0000000100000002
|
||||
|
||||
[TEST_PATH]/backrest/archive/db/9.2-1/0000000100000002:
|
||||
000000010000000200000010-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000011-0000000000000000000000000000000000000000
|
||||
000000010000000200000012-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000016-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000017-0000000000000000000000000000000000000000
|
||||
000000010000000200000018-0000000000000000000000000000000000000000.gz
|
||||
@ -2084,6 +2089,9 @@ db-version="9.2"
|
||||
0000000100000002
|
||||
|
||||
[TEST_PATH]/backrest/archive/db/9.2-1/0000000100000002:
|
||||
000000010000000200000010-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000011-0000000000000000000000000000000000000000
|
||||
000000010000000200000012-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000016-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000017-0000000000000000000000000000000000000000
|
||||
000000010000000200000018-0000000000000000000000000000000000000000.gz
|
||||
@ -2106,8 +2114,9 @@ Expire oldest diff backup (cascade to incr)
|
||||
INFO: expire diff backup set: [BACKUP-DIFF-3], [BACKUP-INCR-2]
|
||||
INFO: remove expired backup [BACKUP-INCR-2]
|
||||
INFO: remove expired backup [BACKUP-DIFF-3]
|
||||
INFO: archive retention from backup [BACKUP-DIFF-4], start = 00000001000000020000001E
|
||||
INFO: expire WAL segments: start = 000000010000000200000016, stop = 00000001000000020000001D
|
||||
INFO: archive retention on backup [BACKUP-FULL-3], start = 000000010000000200000010, stop = 000000010000000200000012
|
||||
INFO: archive retention on backup [BACKUP-DIFF-4], start = 00000001000000020000001E
|
||||
INFO: remove archive: start = 000000010000000200000016, stop = 00000001000000020000001D
|
||||
INFO: expire stop
|
||||
|
||||
+ supplemental file: [TEST_PATH]/backrest/backup/db/backup.info
|
||||
@ -2156,6 +2165,9 @@ db-version="9.2"
|
||||
0000000100000002
|
||||
|
||||
[TEST_PATH]/backrest/archive/db/9.2-1/0000000100000002:
|
||||
000000010000000200000010-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000011-0000000000000000000000000000000000000000
|
||||
000000010000000200000012-0000000000000000000000000000000000000000.gz
|
||||
00000001000000020000001E-0000000000000000000000000000000000000000.gz
|
||||
00000001000000020000001F-0000000000000000000000000000000000000000
|
||||
000000010000000200000020-0000000000000000000000000000000000000000.gz
|
||||
@ -2215,6 +2227,9 @@ db-version="9.2"
|
||||
0000000100000002
|
||||
|
||||
[TEST_PATH]/backrest/archive/db/9.2-1/0000000100000002:
|
||||
000000010000000200000010-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000011-0000000000000000000000000000000000000000
|
||||
000000010000000200000012-0000000000000000000000000000000000000000.gz
|
||||
00000001000000020000001E-0000000000000000000000000000000000000000.gz
|
||||
00000001000000020000001F-0000000000000000000000000000000000000000
|
||||
000000010000000200000020-0000000000000000000000000000000000000000.gz
|
||||
@ -2232,8 +2247,10 @@ Expire archive based on newest incr backup
|
||||
> [BACKREST_BIN] "--config=[TEST_PATH]/backrest/pg_backrest.conf" --stanza=db --log-level-console=info --retention-full=1 --retention-diff=1 --retention-archive-type=incr --retention-archive=1 expire
|
||||
------------------------------------------------------------------------------------------------------------------------------------
|
||||
INFO: expire start: --no-compress --config=[TEST_PATH]/backrest/pg_backrest.conf --log-level-console=info --log-level-file=trace --repo-path=[TEST_PATH]/backrest --retention-archive=1 --retention-archive-type=incr --retention-diff=1 --retention-full=1 --stanza=db
|
||||
INFO: archive retention from backup [BACKUP-INCR-3], start = 000000010000000200000024
|
||||
INFO: expire WAL segments: start = 00000001000000020000001E, stop = 000000010000000200000023
|
||||
INFO: archive retention on backup [BACKUP-FULL-3], start = 000000010000000200000010, stop = 000000010000000200000012
|
||||
INFO: archive retention on backup [BACKUP-DIFF-4], start = 00000001000000020000001E, stop = 000000010000000200000020
|
||||
INFO: archive retention on backup [BACKUP-INCR-3], start = 000000010000000200000024
|
||||
INFO: remove archive: start = 000000010000000200000021, stop = 000000010000000200000023
|
||||
INFO: expire stop
|
||||
|
||||
+ supplemental file: [TEST_PATH]/backrest/backup/db/backup.info
|
||||
@ -2285,6 +2302,12 @@ db-version="9.2"
|
||||
0000000100000002
|
||||
|
||||
[TEST_PATH]/backrest/archive/db/9.2-1/0000000100000002:
|
||||
000000010000000200000010-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000011-0000000000000000000000000000000000000000
|
||||
000000010000000200000012-0000000000000000000000000000000000000000.gz
|
||||
00000001000000020000001E-0000000000000000000000000000000000000000.gz
|
||||
00000001000000020000001F-0000000000000000000000000000000000000000
|
||||
000000010000000200000020-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000024-0000000000000000000000000000000000000000.gz
|
||||
000000010000000200000025-0000000000000000000000000000000000000000
|
||||
000000010000000200000026-0000000000000000000000000000000000000000.gz
|
||||
|
Loading…
x
Reference in New Issue
Block a user