1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-04-25 12:04:48 +02:00

Fixed an issue where WAL was not expired on PostgreSQL 10.

This was caused by a faulty regex that expected all PostgreSQL major versions to be X.X.

Reported by Adam Brusselback.
This commit is contained in:
David Steele 2017-12-18 18:51:19 -05:00
parent 3cc367185e
commit ef3ef85c33
5 changed files with 120 additions and 107 deletions

View File

@ -20,6 +20,14 @@
<p>Fixed an issue that suppressed locality errors for <cmd>backup</cmd> and <cmd>restore</cmd>. When a backup host is present, backups should only be allowed on the backup host and restores should only be allowed on the database host unless an alternate configuration is created that ignores the remote host.</p> <p>Fixed an issue that suppressed locality errors for <cmd>backup</cmd> and <cmd>restore</cmd>. When a backup host is present, backups should only be allowed on the backup host and restores should only be allowed on the database host unless an alternate configuration is created that ignores the remote host.</p>
</release-item> </release-item>
<release-item>
<release-item-contributor-list>
<release-item-ideator id="brusselback.adam"/>
</release-item-contributor-list>
<p>Fixed an issue where WAL was not expired on <postgres/> 10. This was caused by a faulty regex that expected all <postgres/> major versions to be X.X.</p>
</release-item>
</release-bug-list> </release-bug-list>
<release-feature-list> <release-feature-list>
@ -3777,6 +3785,11 @@
<contributor-id type="github">sbiberhofer</contributor-id> <contributor-id type="github">sbiberhofer</contributor-id>
</contributor> </contributor>
<contributor id="brusselback.adam">
<contributor-name-display>Adam Brusselback</contributor-name-display>
<contributor-id type="github">Tostino</contributor-id>
</contributor>
<contributor id="cox.william"> <contributor id="cox.william">
<contributor-name-display>William Cox</contributor-name-display> <contributor-name-display>William Cox</contributor-name-display>
<contributor-id type="github">mydimension</contributor-id> <contributor-id type="github">mydimension</contributor-id>

View File

@ -25,7 +25,7 @@ use pgBackRest::Storage::Helper;
#################################################################################################################################### ####################################################################################################################################
# RegEx constants # RegEx constants
#################################################################################################################################### ####################################################################################################################################
use constant REGEX_ARCHIVE_DIR_DB_VERSION => '^[0-9]+\.[0-9]+-[0-9]+$'; use constant REGEX_ARCHIVE_DIR_DB_VERSION => '^[0-9]+(\.[0-9]+)*-[0-9]+$';
push @EXPORT, qw(REGEX_ARCHIVE_DIR_DB_VERSION); push @EXPORT, qw(REGEX_ARCHIVE_DIR_DB_VERSION);
use constant REGEX_ARCHIVE_DIR_WAL => '^[0-F]{16}$'; use constant REGEX_ARCHIVE_DIR_WAL => '^[0-F]{16}$';
push @EXPORT, qw(REGEX_ARCHIVE_DIR_WAL); push @EXPORT, qw(REGEX_ARCHIVE_DIR_WAL);

View File

@ -239,7 +239,7 @@ sub process
if ($iBackupTotal > 0) if ($iBackupTotal > 0)
{ {
my $oArchiveInfo = new pgBackRest::Archive::Info($oStorageRepo->pathGet(STORAGE_REPO_ARCHIVE), true); my $oArchiveInfo = new pgBackRest::Archive::Info($oStorageRepo->pathGet(STORAGE_REPO_ARCHIVE), true);
my @stryListArchiveDisk = $oStorageRepo->list( my @stryListArchiveDisk = sort {((split('-', $a))[1] + 0) cmp ((split('-', $b))[1] + 0)} $oStorageRepo->list(
STORAGE_REPO_ARCHIVE, {strExpression => REGEX_ARCHIVE_DIR_DB_VERSION, bIgnoreMissing => true}); STORAGE_REPO_ARCHIVE, {strExpression => REGEX_ARCHIVE_DIR_DB_VERSION, bIgnoreMissing => true});
# Make sure the current database versions match between the two files # Make sure the current database versions match between the two files

View File

@ -817,16 +817,16 @@ backrest-version="[VERSION-1]"
[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-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]
db-catalog-version=201510051 db-catalog-version=201707211
db-control-version=942 db-control-version=1002
db-id=3 db-id=3
db-system-id=1000000000000000095 db-system-id=1000000000000000100
db-version="9.5" db-version="10"
[db:history] [db:history]
1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"} 1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"}
2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"} 2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"}
3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":1000000000000000095,"db-version":"9.5"} 3={"db-catalog-version":201707211,"db-control-version":1002,"db-system-id":1000000000000000100,"db-version":"10"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*" > ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
@ -841,6 +841,16 @@ db-version="9.5"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
[TEST_PATH]/db-master/repo/archive/db: [TEST_PATH]/db-master/repo/archive/db:
[TEST_PATH]/db-master/repo/archive/db/10-3:
[TEST_PATH]/db-master/repo/archive/db/10-3/0000000100000000:
000000010000000000000000-0000000000000000000000000000000000000000.gz
000000010000000000000001-0000000000000000000000000000000000000000
000000010000000000000002-0000000000000000000000000000000000000000.gz
000000010000000000000003-0000000000000000000000000000000000000000.gz
000000010000000000000004-0000000000000000000000000000000000000000
000000010000000000000005-0000000000000000000000000000000000000000.gz
[TEST_PATH]/db-master/repo/archive/db/9.2-1: [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:
@ -1124,16 +1134,6 @@ db-version="9.5"
000000010000000100000009-0000000000000000000000000000000000000000 000000010000000100000009-0000000000000000000000000000000000000000
00000001000000010000000A-0000000000000000000000000000000000000000.gz 00000001000000010000000A-0000000000000000000000000000000000000000.gz
[TEST_PATH]/db-master/repo/archive/db/9.5-3:
[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 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 > [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
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
@ -1146,7 +1146,7 @@ P00 INFO: remove expired backup [BACKUP-FULL-2]
P00 INFO: remove archive path: [TEST_PATH]/db-master/repo/archive/db/9.2-1 P00 INFO: remove 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: archive retention on backup [BACKUP-FULL-4], archiveId = 9.3-2, start = 0000000100000000000000FF
P00 DETAIL: remove archive: archiveId = 9.3-2, start = 000000010000000000000000, stop = 0000000100000000000000FE P00 DETAIL: remove archive: archiveId = 9.3-2, start = 000000010000000000000000, stop = 0000000100000000000000FE
P00 DETAIL: archive retention on backup [BACKUP-FULL-5], archiveId = 9.5-3, start = 000000010000000000000000 P00 DETAIL: archive retention on backup [BACKUP-FULL-5], archiveId = 10-3, start = 000000010000000000000000
P00 INFO: expire command end: completed successfully P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info + supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
@ -1162,16 +1162,16 @@ backrest-version="[VERSION-1]"
[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-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]
db-catalog-version=201510051 db-catalog-version=201707211
db-control-version=942 db-control-version=1002
db-id=3 db-id=3
db-system-id=1000000000000000095 db-system-id=1000000000000000100
db-version="9.5" db-version="10"
[db:history] [db:history]
1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"} 1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"}
2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"} 2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"}
3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":1000000000000000095,"db-version":"9.5"} 3={"db-catalog-version":201707211,"db-control-version":1002,"db-system-id":1000000000000000100,"db-version":"10"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*" > ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
@ -1183,6 +1183,16 @@ db-version="9.5"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
[TEST_PATH]/db-master/repo/archive/db: [TEST_PATH]/db-master/repo/archive/db:
[TEST_PATH]/db-master/repo/archive/db/10-3:
[TEST_PATH]/db-master/repo/archive/db/10-3/0000000100000000:
000000010000000000000000-0000000000000000000000000000000000000000.gz
000000010000000000000001-0000000000000000000000000000000000000000
000000010000000000000002-0000000000000000000000000000000000000000.gz
000000010000000000000003-0000000000000000000000000000000000000000.gz
000000010000000000000004-0000000000000000000000000000000000000000
000000010000000000000005-0000000000000000000000000000000000000000.gz
[TEST_PATH]/db-master/repo/archive/db/9.3-2: [TEST_PATH]/db-master/repo/archive/db/9.3-2:
[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000: [TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000:
@ -1201,16 +1211,6 @@ db-version="9.5"
000000010000000100000009-0000000000000000000000000000000000000000 000000010000000100000009-0000000000000000000000000000000000000000
00000001000000010000000A-0000000000000000000000000000000000000000.gz 00000001000000010000000A-0000000000000000000000000000000000000000.gz
[TEST_PATH]/db-master/repo/archive/db/9.5-3:
[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 * full backup: label = [BACKUP-FULL-6], start = 000000010000000000000006, stop = 000000010000000000000008
==================================================================================================================================== ====================================================================================================================================
@ -1228,16 +1228,16 @@ backrest-version="[VERSION-1]"
[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} [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]
db-catalog-version=201510051 db-catalog-version=201707211
db-control-version=942 db-control-version=1002
db-id=3 db-id=3
db-system-id=1000000000000000095 db-system-id=1000000000000000100
db-version="9.5" db-version="10"
[db:history] [db:history]
1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"} 1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"}
2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"} 2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"}
3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":1000000000000000095,"db-version":"9.5"} 3={"db-catalog-version":201707211,"db-control-version":1002,"db-system-id":1000000000000000100,"db-version":"10"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*" > ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
@ -1250,27 +1250,9 @@ db-version="9.5"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
[TEST_PATH]/db-master/repo/archive/db: [TEST_PATH]/db-master/repo/archive/db:
[TEST_PATH]/db-master/repo/archive/db/9.3-2: [TEST_PATH]/db-master/repo/archive/db/10-3:
[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000: [TEST_PATH]/db-master/repo/archive/db/10-3/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:
[TEST_PATH]/db-master/repo/archive/db/9.5-3/0000000100000000:
000000010000000000000000-0000000000000000000000000000000000000000.gz 000000010000000000000000-0000000000000000000000000000000000000000.gz
000000010000000000000001-0000000000000000000000000000000000000000 000000010000000000000001-0000000000000000000000000000000000000000
000000010000000000000002-0000000000000000000000000000000000000000.gz 000000010000000000000002-0000000000000000000000000000000000000000.gz
@ -1284,6 +1266,24 @@ db-version="9.5"
00000001000000000000000A-0000000000000000000000000000000000000000 00000001000000000000000A-0000000000000000000000000000000000000000
00000001000000000000000B-0000000000000000000000000000000000000000.gz 00000001000000000000000B-0000000000000000000000000000000000000000.gz
[TEST_PATH]/db-master/repo/archive/db/9.3-2:
[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
Expire all archive last full backup through pitr 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 > [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
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
@ -1292,9 +1292,9 @@ P00 INFO: expire diff backup [BACKUP-DIFF-1]
P00 INFO: remove expired 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: archive retention on backup [BACKUP-FULL-4], archiveId = 9.3-2, start = 0000000100000000000000FF
P00 DETAIL: no archive to remove, archiveId = 9.3-2 P00 DETAIL: no archive to remove, archiveId = 9.3-2
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-5], archiveId = 10-3, start = 000000010000000000000000, stop = 000000010000000000000002
P00 DETAIL: archive retention on backup [BACKUP-FULL-6], archiveId = 9.5-3, start = 000000010000000000000006 P00 DETAIL: archive retention on backup [BACKUP-FULL-6], archiveId = 10-3, start = 000000010000000000000006
P00 DETAIL: remove archive: archiveId = 9.5-3, start = 000000010000000000000003, stop = 000000010000000000000005 P00 DETAIL: remove archive: archiveId = 10-3, start = 000000010000000000000003, stop = 000000010000000000000005
P00 INFO: expire command end: completed successfully P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info + supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
@ -1310,16 +1310,16 @@ backrest-version="[VERSION-1]"
[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} [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]
db-catalog-version=201510051 db-catalog-version=201707211
db-control-version=942 db-control-version=1002
db-id=3 db-id=3
db-system-id=1000000000000000095 db-system-id=1000000000000000100
db-version="9.5" db-version="10"
[db:history] [db:history]
1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"} 1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"}
2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"} 2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"}
3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":1000000000000000095,"db-version":"9.5"} 3={"db-catalog-version":201707211,"db-control-version":1002,"db-system-id":1000000000000000100,"db-version":"10"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*" > ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
@ -1331,6 +1331,19 @@ db-version="9.5"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
[TEST_PATH]/db-master/repo/archive/db: [TEST_PATH]/db-master/repo/archive/db:
[TEST_PATH]/db-master/repo/archive/db/10-3:
[TEST_PATH]/db-master/repo/archive/db/10-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
[TEST_PATH]/db-master/repo/archive/db/9.3-2: [TEST_PATH]/db-master/repo/archive/db/9.3-2:
[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000: [TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000:
@ -1349,19 +1362,6 @@ db-version="9.5"
000000010000000100000009-0000000000000000000000000000000000000000 000000010000000100000009-0000000000000000000000000000000000000000
00000001000000010000000A-0000000000000000000000000000000000000000.gz 00000001000000010000000A-0000000000000000000000000000000000000000.gz
[TEST_PATH]/db-master/repo/archive/db/9.5-3:
[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
+ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info + supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
--------------------------------------------------------------------- ---------------------------------------------------------------------
[backrest] [backrest]
@ -1375,16 +1375,16 @@ backrest-version="[VERSION-1]"
[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} [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]
db-catalog-version=201510051 db-catalog-version=201707211
db-control-version=942 db-control-version=1002
db-id=3 db-id=3
db-system-id=1000000000000000095 db-system-id=1000000000000000100
db-version="9.5" db-version="10"
[db:history] [db:history]
1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"} 1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"}
2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"} 2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"}
3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":1000000000000000095,"db-version":"9.5"} 3={"db-catalog-version":201707211,"db-control-version":1002,"db-system-id":1000000000000000100,"db-version":"10"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*" > ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
@ -1396,6 +1396,19 @@ db-version="9.5"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
[TEST_PATH]/db-master/repo/archive/db: [TEST_PATH]/db-master/repo/archive/db:
[TEST_PATH]/db-master/repo/archive/db/10-3:
[TEST_PATH]/db-master/repo/archive/db/10-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
[TEST_PATH]/db-master/repo/archive/db/9.3-2: [TEST_PATH]/db-master/repo/archive/db/9.3-2:
[TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000: [TEST_PATH]/db-master/repo/archive/db/9.3-2/0000000100000000:
@ -1414,19 +1427,6 @@ db-version="9.5"
000000010000000100000009-0000000000000000000000000000000000000000 000000010000000100000009-0000000000000000000000000000000000000000
00000001000000010000000A-0000000000000000000000000000000000000000.gz 00000001000000010000000A-0000000000000000000000000000000000000000.gz
[TEST_PATH]/db-master/repo/archive/db/9.5-3:
[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
Expire all archive except for the current database Expire all archive except for the current database
> [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 > [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
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
@ -1434,8 +1434,8 @@ P00 INFO: expire command begin [BACKREST-VERSION]: --config=[TEST_PATH]/db-mas
P00 INFO: expire full backup [BACKUP-FULL-4] P00 INFO: expire full backup [BACKUP-FULL-4]
P00 INFO: remove expired backup [BACKUP-FULL-4] P00 INFO: remove expired backup [BACKUP-FULL-4]
P00 INFO: remove archive path: [TEST_PATH]/db-master/repo/archive/db/9.3-2 P00 INFO: remove archive path: [TEST_PATH]/db-master/repo/archive/db/9.3-2
P00 DETAIL: archive retention on backup [BACKUP-FULL-5], archiveId = 9.5-3, start = 000000010000000000000000 P00 DETAIL: archive retention on backup [BACKUP-FULL-5], archiveId = 10-3, start = 000000010000000000000000
P00 DETAIL: no archive to remove, archiveId = 9.5-3 P00 DETAIL: no archive to remove, archiveId = 10-3
P00 INFO: expire command end: completed successfully P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info + supplemental file: [TEST_PATH]/db-master/repo/backup/db/backup.info
@ -1450,16 +1450,16 @@ backrest-version="[VERSION-1]"
[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} [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]
db-catalog-version=201510051 db-catalog-version=201707211
db-control-version=942 db-control-version=1002
db-id=3 db-id=3
db-system-id=1000000000000000095 db-system-id=1000000000000000100
db-version="9.5" db-version="10"
[db:history] [db:history]
1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"} 1={"db-catalog-version":201204301,"db-control-version":922,"db-system-id":1000000000000000092,"db-version":"9.2"}
2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"} 2={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":1000000000000000093,"db-version":"9.3"}
3={"db-catalog-version":201510051,"db-control-version":942,"db-system-id":1000000000000000095,"db-version":"9.5"} 3={"db-catalog-version":201707211,"db-control-version":1002,"db-system-id":1000000000000000100,"db-version":"10"}
> ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*" > ls [TEST_PATH]/db-master/repo/backup/db | grep -v "backup.*"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
@ -1470,9 +1470,9 @@ db-version="9.5"
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
[TEST_PATH]/db-master/repo/archive/db: [TEST_PATH]/db-master/repo/archive/db:
[TEST_PATH]/db-master/repo/archive/db/9.5-3: [TEST_PATH]/db-master/repo/archive/db/10-3:
[TEST_PATH]/db-master/repo/archive/db/9.5-3/0000000100000000: [TEST_PATH]/db-master/repo/archive/db/10-3/0000000100000000:
000000010000000000000000-0000000000000000000000000000000000000000.gz 000000010000000000000000-0000000000000000000000000000000000000000.gz
000000010000000000000001-0000000000000000000000000000000000000000 000000010000000000000001-0000000000000000000000000000000000000000
000000010000000000000002-0000000000000000000000000000000000000000.gz 000000010000000000000002-0000000000000000000000000000000000000000.gz

View File

@ -219,7 +219,7 @@ sub run
$strDescription = 'Upgrade the stanza, create full back - earliest db orphaned archive removed and earliest full backup ' . $strDescription = 'Upgrade the stanza, create full back - earliest db orphaned archive removed and earliest full backup ' .
'and archive in previous db version removed'; 'and archive in previous db version removed';
$oExpireTest->stanzaUpgrade($self->stanza(), PG_VERSION_95); $oExpireTest->stanzaUpgrade($self->stanza(), PG_VERSION_10);
$oExpireTest->backupCreate($self->stanza(), CFGOPTVAL_BACKUP_TYPE_FULL, $lBaseTime += SECONDS_PER_DAY); $oExpireTest->backupCreate($self->stanza(), CFGOPTVAL_BACKUP_TYPE_FULL, $lBaseTime += SECONDS_PER_DAY);
$oExpireTest->process($self->stanza(), 2, undef, CFGOPTVAL_BACKUP_TYPE_FULL, undef, $strDescription); $oExpireTest->process($self->stanza(), 2, undef, CFGOPTVAL_BACKUP_TYPE_FULL, undef, $strDescription);