pgbackrest.git / summary / log / commit / refs
commit aceb956815a87f0c19ea171de25d2c3842a6d806
Author: Cynthia Shang <cynthia.shang@crunchydata.com>
Commit: GitHub <noreply@github.com>
Date: Thu May 27 12:03:44 2021 +0000
Change archive expiration logging from detail to info level.
To assist with issue debugging, removal of files during archive expiration has been changed from detail level logging to info level.
doc/xml/release.xml | 11 +++
src/command/expire/expire.c | 6 +-
test/expect/mock-expire-001.log | 28 +++----
test/expect/mock-expire-002.log | 14 ++--
test/src/module/command/expireTest.c | 142 +++++++++++++++++++++++------------
5 files changed, 128 insertions(+), 73 deletions(-)
diff --git a/doc/xml/release.xml b/doc/xml/release.xml
index 020ab76eb..186bed759 100644
--- a/doc/xml/release.xml
+++ b/doc/xml/release.xml
@@ -126,6 +126,17 @@
</release-feature-list>
<release-improvement-list>
+ <release-item>
+ <github-pull-request id="1416"/>
+
+ <release-item-contributor-list>
+ <release-item-contributor id="cynthia.shang"/>
+ <release-item-reviewer id="david.steele"/>
+ </release-item-contributor-list>
+
+ <p>Change archive expiration logging from detail to info level.</p>
+ </release-item>
+
<release-item>
<github-issue id="1357"/>
<github-pull-request id="1386"/>
diff --git a/src/command/expire/expire.c b/src/command/expire/expire.c
index bed045678..664e4230f 100644
--- a/src/command/expire/expire.c
+++ b/src/command/expire/expire.c
@@ -355,7 +355,7 @@ logExpire(ArchiveExpired *archiveExpire, String *archiveId, unsigned int repoIdx
if (archiveExpire->start != NULL)
{
// Force out any remaining message
- LOG_DETAIL_FMT(
+ LOG_INFO_FMT(
"repo%u: %s remove archive, start = %s, stop = %s", cfgOptionGroupIdxToKey(cfgOptGrpRepo, repoIdx), strZ(archiveId),
strZ(archiveExpire->start), strZ(archiveExpire->stop));
@@ -733,7 +733,7 @@ removeExpiredArchive(InfoBackup *infoBackup, bool timeBasedFullRetention, unsign
// Log if no archive was expired
if (archiveExpire.total == 0)
{
- LOG_DETAIL_FMT(
+ LOG_INFO_FMT(
"repo%u: %s no archive to remove", cfgOptionGroupIdxToKey(cfgOptGrpRepo, repoIdx),
strZ(archiveId));
}
@@ -767,7 +767,7 @@ removeExpiredArchive(InfoBackup *infoBackup, bool timeBasedFullRetention, unsign
strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strZ(archiveId), strZ(historyFile)));
}
- LOG_DETAIL_FMT(
+ LOG_INFO_FMT(
"repo%u: %s remove history file %s", cfgOptionGroupIdxToKey(cfgOptGrpRepo, repoIdx),
strZ(archiveId), strZ(historyFile));
}
diff --git a/test/expect/mock-expire-001.log b/test/expect/mock-expire-001.log
index cfa14ab1c..ef1cc9fcb 100644
--- a/test/expect/mock-expire-001.log
+++ b/test/expect/mock-expire-001.log
@@ -301,7 +301,7 @@ Nothing to expire
------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: expire command begin [BACKREST-VERSION]: --buffer-size=[BUFFER-SIZE] --config=[TEST_PATH]/db-primary/pgbackrest.conf --exec-id=[EXEC-ID] --lock-path=[TEST_PATH]/db-primary/lock --log-level-console=detail --log-level-file=[LOG-LEVEL-FILE] --log-level-stderr=off --log-path=[TEST_PATH]/db-primary/log --no-log-timestamp --repo1-path=[TEST_PATH]/db-primary/repo --repo1-retention-archive=1 --repo1-retention-archive-type=full --repo1-retention-diff=1 --repo1-retention-full=1 --stanza=db
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-1], start = 000000010000000000000000
-P00 DETAIL: repo1: 9.2-1 no archive to remove
+P00 INFO: repo1: 9.2-1 no archive to remove
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -907,7 +907,7 @@ P00 INFO: repo1: expire full backup set [BACKUP-FULL-1], [BACKUP-INCR-1]
P00 INFO: repo1: remove expired backup [BACKUP-INCR-1]
P00 INFO: repo1: remove expired backup [BACKUP-FULL-1]
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-2], start = 000000010000000100000000
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 0000000100000000, stop = 0000000100000000
+P00 INFO: repo1: 9.2-1 remove archive, start = 0000000100000000, stop = 0000000100000000
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -1272,7 +1272,7 @@ P00 INFO: expire command begin [BACKREST-VERSION]: --buffer-size=[BUFFER-SIZE]
P00 INFO: repo1: expire diff backup [BACKUP-DIFF-1]
P00 INFO: repo1: remove expired backup [BACKUP-DIFF-1]
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-2], start = 000000010000000100000000
-P00 DETAIL: repo1: 9.2-1 no archive to remove
+P00 INFO: repo1: 9.2-1 no archive to remove
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -1927,8 +1927,8 @@ P00 INFO: repo1: remove expired backup [BACKUP-DIFF-2]
P00 INFO: repo1: remove expired backup [BACKUP-FULL-2]
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-3], start = 000000010000000200000010, stop = 000000010000000200000012
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-DIFF-3], start = 000000010000000200000016
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 0000000100000001, stop = 00000001000000020000000F
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 000000010000000200000013, stop = 000000010000000200000015
+P00 INFO: repo1: 9.2-1 remove archive, start = 0000000100000001, stop = 00000001000000020000000F
+P00 INFO: repo1: 9.2-1 remove archive, start = 000000010000000200000013, stop = 000000010000000200000015
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -2049,7 +2049,7 @@ P00 INFO: repo1: remove expired backup [BACKUP-INCR-2]
P00 INFO: repo1: remove expired backup [BACKUP-DIFF-3]
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-3], start = 000000010000000200000010, stop = 000000010000000200000012
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-DIFF-4], start = 00000001000000020000001E
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 000000010000000200000016, stop = 00000001000000020000001D
+P00 INFO: repo1: 9.2-1 remove archive, start = 000000010000000200000016, stop = 00000001000000020000001D
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -2160,7 +2160,7 @@ P00 INFO: expire command begin [BACKREST-VERSION]: --buffer-size=[BUFFER-SIZE]
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-3], start = 000000010000000200000010, stop = 000000010000000200000012
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-DIFF-4], start = 00000001000000020000001E, stop = 000000010000000200000020
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-INCR-3], start = 000000010000000200000024
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 000000010000000200000021, stop = 000000010000000200000023
+P00 INFO: repo1: 9.2-1 remove archive, start = 000000010000000200000021, stop = 000000010000000200000023
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -2304,8 +2304,8 @@ P00 INFO: repo1: remove expired backup [BACKUP-DIFF-4]
P00 INFO: repo1: remove expired backup [BACKUP-FULL-3]
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-4], start = 00000001000000020000002A, stop = 00000001000000020000002C
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-5], start = 000000010000000200000036
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 000000010000000200000010, stop = 000000010000000200000029
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 00000001000000020000002D, stop = 000000010000000200000035
+P00 INFO: repo1: 9.2-1 remove archive, start = 000000010000000200000010, stop = 000000010000000200000029
+P00 INFO: repo1: 9.2-1 remove archive, start = 00000001000000020000002D, stop = 000000010000000200000035
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -2440,9 +2440,9 @@ P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-5], start = 00
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-6], start = 00000001000000020000003C, stop = 00000001000000020000003E
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-DIFF-6], start = 000000010000000200000042, stop = 000000010000000200000044
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-DIFF-7], start = 000000010000000200000048
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 000000010000000200000039, stop = 00000001000000020000003B
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 00000001000000020000003F, stop = 000000010000000200000041
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 000000010000000200000045, stop = 000000010000000200000047
+P00 INFO: repo1: 9.2-1 remove archive, start = 000000010000000200000039, stop = 00000001000000020000003B
+P00 INFO: repo1: 9.2-1 remove archive, start = 00000001000000020000003F, stop = 000000010000000200000041
+P00 INFO: repo1: 9.2-1 remove archive, start = 000000010000000200000045, stop = 000000010000000200000047
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -2598,8 +2598,8 @@ P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-DIFF-6], start = 00
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-DIFF-7], start = 000000010000000200000048, stop = 00000001000000020000004A
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-7], start = 00000001000000020000004E, stop = 000000010000000200000050
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-8], start = 000000010000000200000054
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 00000001000000020000004B, stop = 00000001000000020000004D
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 000000010000000200000051, stop = 000000010000000200000053
+P00 INFO: repo1: 9.2-1 remove archive, start = 00000001000000020000004B, stop = 00000001000000020000004D
+P00 INFO: repo1: 9.2-1 remove archive, start = 000000010000000200000051, stop = 000000010000000200000053
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
diff --git a/test/expect/mock-expire-002.log b/test/expect/mock-expire-002.log
index a06251248..518f6bdfe 100644
--- a/test/expect/mock-expire-002.log
+++ b/test/expect/mock-expire-002.log
@@ -480,9 +480,9 @@ P00 INFO: repo1: expire full backup set [BACKUP-FULL-1], [BACKUP-INCR-1]
P00 INFO: repo1: remove expired backup [BACKUP-INCR-1]
P00 INFO: repo1: remove expired backup [BACKUP-FULL-1]
P00 DETAIL: repo1: 9.2-1 archive retention on backup [BACKUP-FULL-2], start = 00000001000000000000000C
-P00 DETAIL: repo1: 9.2-1 remove archive, start = 000000010000000000000000, stop = 00000001000000000000000B
+P00 INFO: repo1: 9.2-1 remove archive, start = 000000010000000000000000, stop = 00000001000000000000000B
P00 DETAIL: repo1: 9.3-2 archive retention on backup [BACKUP-FULL-3], start = 000000010000000000000000
-P00 DETAIL: repo1: 9.3-2 no archive to remove
+P00 INFO: repo1: 9.3-2 no archive to remove
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -1156,9 +1156,9 @@ P00 INFO: repo1: remove expired backup [BACKUP-FULL-3]
P00 INFO: repo1: remove expired backup [BACKUP-FULL-2]
P00 INFO: repo1: remove archive path [TEST_PATH]/db-primary/repo/archive/db/9.2-1
P00 DETAIL: repo1: 9.3-2 archive retention on backup [BACKUP-FULL-4], start = 0000000100000000000000FF
-P00 DETAIL: repo1: 9.3-2 remove archive, start = 000000010000000000000000, stop = 0000000100000000000000FE
+P00 INFO: repo1: 9.3-2 remove archive, start = 000000010000000000000000, stop = 0000000100000000000000FE
P00 DETAIL: repo1: 10-3 archive retention on backup [BACKUP-FULL-5], start = 000000010000000000000000
-P00 DETAIL: repo1: 10-3 no archive to remove
+P00 INFO: repo1: 10-3 no archive to remove
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -1307,10 +1307,10 @@ P00 INFO: expire command begin [BACKREST-VERSION]: --buffer-size=[BUFFER-SIZE]
P00 INFO: repo1: expire diff backup [BACKUP-DIFF-1]
P00 INFO: repo1: remove expired backup [BACKUP-DIFF-1]
P00 DETAIL: repo1: 9.3-2 archive retention on backup [BACKUP-FULL-4], start = 0000000100000000000000FF
-P00 DETAIL: repo1: 9.3-2 no archive to remove
+P00 INFO: repo1: 9.3-2 no archive to remove
P00 DETAIL: repo1: 10-3 archive retention on backup [BACKUP-FULL-5], start = 000000010000000000000000, stop = 000000010000000000000002
P00 DETAIL: repo1: 10-3 archive retention on backup [BACKUP-FULL-6], start = 000000010000000000000006
-P00 DETAIL: repo1: 10-3 remove archive, start = 000000010000000000000003, stop = 000000010000000000000005
+P00 INFO: repo1: 10-3 remove archive, start = 000000010000000000000003, stop = 000000010000000000000005
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
@@ -1455,7 +1455,7 @@ P00 INFO: repo1: expire full backup [BACKUP-FULL-4]
P00 INFO: repo1: remove expired backup [BACKUP-FULL-4]
P00 INFO: repo1: remove archive path [TEST_PATH]/db-primary/repo/archive/db/9.3-2
P00 DETAIL: repo1: 10-3 archive retention on backup [BACKUP-FULL-5], start = 000000010000000000000000
-P00 DETAIL: repo1: 10-3 no archive to remove
+P00 INFO: repo1: 10-3 no archive to remove
P00 INFO: expire command end: completed successfully
+ supplemental file: [TEST_PATH]/db-primary/repo/backup/db/backup.info
diff --git a/test/src/module/command/expireTest.c b/test/src/module/command/expireTest.c
index 9b4fb2c22..55ebb2243 100644
--- a/test/src/module/command/expireTest.c
+++ b/test/src/module/command/expireTest.c
@@ -685,6 +685,9 @@ testRun(void)
storageTest, strNewFmt("%s/%s/%s", strZ(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc),
archiveExpectList(3, 10, "0000000100000000"),
"000000010000000000000001 and 000000010000000000000002 removed from 10-2/0000000100000000");
+ TEST_RESULT_LOG(
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000001\n"
+ "P00 INFO: repo1: 10-2 remove archive, start = 000000010000000000000001, stop = 000000010000000000000002");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("retention-archive set - latest archive not expired");
@@ -711,6 +714,10 @@ testRun(void)
storageTest, strNewFmt("%s/%s/%s", strZ(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc),
archiveExpectList(3, 10, "0000000100000000"),
"none removed from 10-2/0000000100000000");
+ // Only last 2 full backups and dependents are PITRable, first full backup is not
+ TEST_RESULT_LOG(
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000010000000000000003, stop = 000000020000000000000001\n"
+ "P00 INFO: repo1: 10-2 no archive to remove");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("retention-archive set to lowest - keep PITR for each archiveId");
@@ -736,6 +743,9 @@ testRun(void)
strLstSort(storageListP(
storageTest, strNewFmt("%s/%s/%s", strZ(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc),
archiveExpectList(3, 10, "0000000100000000"), "none removed from 10-2/0000000100000000");
+ TEST_RESULT_LOG(
+ "P00 INFO: repo1: 9.4-1 no archive to remove\n"
+ "P00 INFO: repo1: 10-2 no archive to remove");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("retention-archive, retention-archive-type=diff, retention-diff set");
@@ -770,6 +780,11 @@ testRun(void)
strLstSort(storageListP(
storageTest, strNewFmt("%s/%s/%s", strZ(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc),
archiveExpectList(3, 10, "0000000100000000"), "none removed from 10-2/0000000100000000");
+ TEST_RESULT_LOG(
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000020000000000000003, stop = 000000020000000000000003\n"
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000020000000000000006, stop = 000000020000000000000006\n"
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000020000000000000008, stop = 000000020000000000000008\n"
+ "P00 INFO: repo1: 10-2 no archive to remove");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("retention-archive, retention-archive-type=incr");
@@ -804,6 +819,11 @@ testRun(void)
strLstSort(storageListP(
storageTest, strNewFmt("%s/%s/%s", strZ(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc),
archiveExpectList(3, 10, "0000000100000000"), "none removed from 10-2/0000000100000000");
+ TEST_RESULT_LOG(
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000020000000000000001, stop = 000000020000000000000001\n"
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000020000000000000003, stop = 000000020000000000000003\n"
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000020000000000000006, stop = 000000020000000000000006\n"
+ "P00 INFO: repo1: 10-2 no archive to remove");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire command - dry run");
@@ -842,13 +862,16 @@ testRun(void)
TEST_RESULT_VOID(cmdExpire(), "expire (dry-run) do not remove last backup in archive sub path or sub path");
TEST_RESULT_BOOL(
storagePathExistsP(storageTest, strNewFmt("%s/%s", strZ(archiveStanzaPath), "9.4-1/0000000100000000")), true,
- "archive sub path not removed");
+ "archive sub path not removed because of dry-run, else would be removed");
TEST_RESULT_BOOL(
storageExistsP(storageTest, strNewFmt("%s/20181119-152138F/" BACKUP_MANIFEST_FILE, strZ(backupStanzaPath))), true,
- "backup not removed");
+ "backup not removed because of dry-run, else would be removed");
TEST_RESULT_LOG(
"P00 INFO: [DRY-RUN] repo1: expire full backup 20181119-152138F\n"
- "P00 INFO: [DRY-RUN] repo1: remove expired backup 20181119-152138F");
+ "P00 INFO: [DRY-RUN] repo1: remove expired backup 20181119-152138F\n"
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 0000000100000000, stop = 0000000100000000\n"
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000020000000000000008, stop = 000000020000000000000008\n"
+ "P00 INFO: [DRY-RUN] repo1: 10-2 no archive to remove");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire via backup command");
@@ -892,7 +915,10 @@ testRun(void)
TEST_RESULT_LOG(
"P00 INFO: repo2: expire full backup 20181119-152138F\n"
- "P00 INFO: repo2: remove expired backup 20181119-152138F");
+ "P00 INFO: repo2: remove expired backup 20181119-152138F\n"
+ "P00 INFO: repo2: 9.4-1 remove archive, start = 0000000100000000, stop = 0000000100000000\n"
+ "P00 INFO: repo2: 9.4-1 remove archive, start = 000000020000000000000008, stop = 000000020000000000000008\n"
+ "P00 INFO: repo2: 10-2 no archive to remove");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire command - no dry run");
@@ -907,7 +933,10 @@ testRun(void)
"archive sub path removed");
TEST_RESULT_LOG(
"P00 INFO: repo1: expire full backup 20181119-152138F\n"
- "P00 INFO: repo1: remove expired backup 20181119-152138F");
+ "P00 INFO: repo1: remove expired backup 20181119-152138F\n"
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 0000000100000000, stop = 0000000100000000\n"
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000020000000000000008, stop = 000000020000000000000008\n"
+ "P00 INFO: repo1: 10-2 no archive to remove");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire command - multi-repo errors, continue to next repo after error");
@@ -997,10 +1026,10 @@ testRun(void)
" stop = 000000020000000000000002\n"
"P00 DETAIL: [DRY-RUN] repo2: 9.4-1 archive retention on backup 20181119-152800F_20181119-152252D,"
" start = 000000020000000000000009\n"
- "P00 DETAIL: [DRY-RUN] repo2: 9.4-1 remove archive, start = 000000020000000000000004,"
+ "P00 INFO: [DRY-RUN] repo2: 9.4-1 remove archive, start = 000000020000000000000004,"
" stop = 000000020000000000000007\n"
"P00 DETAIL: [DRY-RUN] repo2: 10-2 archive retention on backup 20181119-152900F, start = 000000010000000000000003\n"
- "P00 DETAIL: [DRY-RUN] repo2: 10-2 no archive to remove",
+ "P00 INFO: [DRY-RUN] repo2: 10-2 no archive to remove",
strZ(backupInfoFileName), strZ(strNewFmt("%s" INFO_COPY_EXT, strZ(backupInfoFileName))), strZ(backupInfoFileName),
strZ(strNewFmt("%s" INFO_COPY_EXT, strZ(backupInfoFileName))));
@@ -1042,7 +1071,7 @@ testRun(void)
"P00 INFO: [DRY-RUN] repo1: remove expired backup 20181119-152800F\n"
"P00 INFO: [DRY-RUN] repo1: remove archive path " TEST_PATH "/%s/9.4-1\n"
"P00 DETAIL: [DRY-RUN] repo1: 10-2 archive retention on backup 20181119-152900F, start = 000000010000000000000003\n"
- "P00 DETAIL: [DRY-RUN] repo1: 10-2 no archive to remove\n"
+ "P00 INFO: [DRY-RUN] repo1: 10-2 no archive to remove\n"
"P00 INFO: [DRY-RUN] repo2: expire diff backup set 20181119-152800F_20181119-152152D,"
" 20181119-152800F_20181119-152155I\n"
"P00 INFO: [DRY-RUN] repo2: remove expired backup 20181119-152800F_20181119-152155I\n"
@@ -1051,10 +1080,10 @@ testRun(void)
" stop = 000000020000000000000002\n"
"P00 DETAIL: [DRY-RUN] repo2: 9.4-1 archive retention on backup 20181119-152800F_20181119-152252D,"
" start = 000000020000000000000009\n"
- "P00 DETAIL: [DRY-RUN] repo2: 9.4-1 remove archive, start = 000000020000000000000004,"
+ "P00 INFO: [DRY-RUN] repo2: 9.4-1 remove archive, start = 000000020000000000000004,"
" stop = 000000020000000000000007\n"
"P00 DETAIL: [DRY-RUN] repo2: 10-2 archive retention on backup 20181119-152900F, start = 000000010000000000000003\n"
- "P00 DETAIL: [DRY-RUN] repo2: 10-2 no archive to remove",
+ "P00 INFO: [DRY-RUN] repo2: 10-2 no archive to remove",
strZ(archiveStanzaPath));
//--------------------------------------------------------------------------------------------------------------------------
@@ -1077,7 +1106,7 @@ testRun(void)
"P00 INFO: repo1: remove expired backup 20181119-152800F\n"
"P00 INFO: repo1: remove archive path " TEST_PATH "/%s/9.4-1\n"
"P00 DETAIL: repo1: 10-2 archive retention on backup 20181119-152900F, start = 000000010000000000000003\n"
- "P00 DETAIL: repo1: 10-2 no archive to remove\n"
+ "P00 INFO: repo1: 10-2 no archive to remove\n"
"P00 INFO: repo2: expire diff backup set 20181119-152800F_20181119-152152D,"
" 20181119-152800F_20181119-152155I\n"
"P00 INFO: repo2: remove expired backup 20181119-152800F_20181119-152155I\n"
@@ -1086,9 +1115,9 @@ testRun(void)
" stop = 000000020000000000000002\n"
"P00 DETAIL: repo2: 9.4-1 archive retention on backup 20181119-152800F_20181119-152252D,"
" start = 000000020000000000000009\n"
- "P00 DETAIL: repo2: 9.4-1 remove archive, start = 000000020000000000000004, stop = 000000020000000000000007\n"
+ "P00 INFO: repo2: 9.4-1 remove archive, start = 000000020000000000000004, stop = 000000020000000000000007\n"
"P00 DETAIL: repo2: 10-2 archive retention on backup 20181119-152900F, start = 000000010000000000000003\n"
- "P00 DETAIL: repo2: 10-2 no archive to remove",
+ "P00 INFO: repo2: 10-2 no archive to remove",
strZ(archiveStanzaPath));
TEST_ASSIGN(infoBackup, infoBackupLoadFile(storageTest, backupInfoFileName, cipherTypeNone, NULL), "get backup.info");
@@ -1109,8 +1138,11 @@ testRun(void)
TEST_RESULT_VOID(cmdExpire(), "label format OK but backup does not exist on any repo");
TEST_RESULT_LOG(
+ "P00 INFO: repo1: 10-2 no archive to remove\n"
"P00 WARN: backup 20201119-123456F_20201119-234567I does not exist\n"
- " HINT: run the info command and confirm the backup is listed");
+ " HINT: run the info command and confirm the backup is listed\n"
+ "P00 INFO: repo2: 9.4-1 no archive to remove\n"
+ "P00 INFO: repo2: 10-2 no archive to remove");
// Rerun on single repo
hrnCfgArgRawZ(argList2, cfgOptRepo, "1");
@@ -1119,7 +1151,8 @@ testRun(void)
TEST_RESULT_VOID(cmdExpire(), "label format OK but backup does not exist on requested repo");
TEST_RESULT_LOG(
"P00 WARN: backup 20201119-123456F_20201119-234567I does not exist\n"
- " HINT: run the info command and confirm the backup is listed");
+ " HINT: run the info command and confirm the backup is listed\n"
+ "P00 INFO: repo1: 10-2 no archive to remove");
// With multiple repos, adhoc expire backup only on one repo
hrnCfgArgRawZ(argList, cfgOptSet, "20181119-152900F_20181119-152500I");
@@ -1127,6 +1160,7 @@ testRun(void)
hrnCfgArgRawBool(argList, cfgOptDryRun, true);
harnessCfgLoad(cfgCmdExpire, argList);
+ // Incremental removed but no archives expired because the only remaining full backups must be able to play through PITR
TEST_RESULT_VOID(cmdExpire(), "label format OK and expired on specified repo");
TEST_RESULT_LOG(
"P00 WARN: [DRY-RUN] repo1: expiring latest backup 20181119-152900F_20181119-152500I - the ability to perform"
@@ -1134,7 +1168,8 @@ testRun(void)
" HINT: non-default settings for 'repo1-retention-archive'/'repo1-retention-archive-type' (even in prior"
" expires) can cause gaps in the WAL.\n"
"P00 INFO: [DRY-RUN] repo1: expire adhoc backup 20181119-152900F_20181119-152500I\n"
- "P00 INFO: [DRY-RUN] repo1: remove expired backup 20181119-152900F_20181119-152500I");
+ "P00 INFO: [DRY-RUN] repo1: remove expired backup 20181119-152900F_20181119-152500I\n"
+ "P00 INFO: [DRY-RUN] repo1: 10-2 no archive to remove");
// Incorrect backup label format provided
argList = strLstDup(argListAvoidWarn);
@@ -1153,7 +1188,9 @@ testRun(void)
harnessCfgLoad(cfgCmdBackup, argList);
TEST_RESULT_VOID(cmdExpire(), "expire remove archive path");
- TEST_RESULT_LOG_FMT("P00 INFO: repo1: remove archive path " TEST_PATH "/%s/9.4-1", strZ(archiveStanzaPath));
+ TEST_RESULT_LOG_FMT(
+ "P00 INFO: repo1: remove archive path " TEST_PATH "/%s/9.4-1\n"
+ "P00 INFO: repo1: 10-2 no archive to remove", strZ(archiveStanzaPath));
//--------------------------------------------------------------------------------------------------------------------------
storagePutP(storageNewWriteP(storageTest, backupInfoFileName),
@@ -1230,8 +1267,8 @@ testRun(void)
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152138F, start = 000000010000000000000002,"
" stop = 000000010000000000000002\n"
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152900F, start = 000000010000000000000004\n"
- "P00 DETAIL: repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000001\n"
- "P00 DETAIL: repo1: 9.4-1 remove archive, start = 000000010000000000000003, stop = 000000010000000000000003");
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000001\n"
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000010000000000000003, stop = 000000010000000000000003");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire history files - dry run");
@@ -1318,10 +1355,10 @@ testRun(void)
TEST_RESULT_LOG(
"P00 DETAIL: [DRY-RUN] repo1: 9.4-1 archive retention on backup 20181119-152138F, start = 000000010000000000000002\n"
- "P00 DETAIL: [DRY-RUN] repo1: 9.4-1 no archive to remove\n"
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 no archive to remove\n"
"P00 DETAIL: [DRY-RUN] repo1: 10-2 archive retention on backup 20181119-152900F, start = 000000030000000000000006\n"
- "P00 DETAIL: [DRY-RUN] repo1: 10-2 no archive to remove\n"
- "P00 DETAIL: [DRY-RUN] repo1: 10-2 remove history file 00000002.history");
+ "P00 INFO: [DRY-RUN] repo1: 10-2 no archive to remove\n"
+ "P00 INFO: [DRY-RUN] repo1: 10-2 remove history file 00000002.history");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire history files - no dry run");
@@ -1341,10 +1378,10 @@ testRun(void)
TEST_RESULT_LOG(
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152138F, start = 000000010000000000000002\n"
- "P00 DETAIL: repo1: 9.4-1 no archive to remove\n"
+ "P00 INFO: repo1: 9.4-1 no archive to remove\n"
"P00 DETAIL: repo1: 10-2 archive retention on backup 20181119-152900F, start = 000000030000000000000006\n"
- "P00 DETAIL: repo1: 10-2 no archive to remove\n"
- "P00 DETAIL: repo1: 10-2 remove history file 00000002.history");
+ "P00 INFO: repo1: 10-2 no archive to remove\n"
+ "P00 INFO: repo1: 10-2 remove history file 00000002.history");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire history files via backup command");
@@ -1368,10 +1405,10 @@ testRun(void)
TEST_RESULT_LOG(
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152138F, start = 000000010000000000000002\n"
- "P00 DETAIL: repo1: 9.4-1 no archive to remove\n"
+ "P00 INFO: repo1: 9.4-1 no archive to remove\n"
"P00 DETAIL: repo1: 10-2 archive retention on backup 20181119-152900F, start = 000000030000000000000006\n"
- "P00 DETAIL: repo1: 10-2 no archive to remove\n"
- "P00 DETAIL: repo1: 10-2 remove history file 00000002.history");
+ "P00 INFO: repo1: 10-2 no archive to remove\n"
+ "P00 INFO: repo1: 10-2 remove history file 00000002.history");
harnessLogLevelReset();
@@ -1427,6 +1464,8 @@ testRun(void)
"2018/20181119-152900F_20181119-152500I.manifest.gz\n");
TEST_RESULT_LOG(
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 no archive to remove\n"
+ "P00 INFO: [DRY-RUN] repo1: 10-2 no archive to remove\n"
"P00 INFO: [DRY-RUN] repo1: remove expired backup history path 2017\n"
"P00 INFO: [DRY-RUN] repo1: remove expired backup history manifest 20181029-152138F_20181104-152138I.manifest.gz\n"
"P00 INFO: [DRY-RUN] repo1: remove expired backup history manifest 20181029-152138F.manifest.gz");
@@ -1457,6 +1496,8 @@ testRun(void)
"2019/20191119-152138F.manifest.gz\n");
TEST_RESULT_LOG(
+ "P00 INFO: repo1: 9.4-1 no archive to remove\n"
+ "P00 INFO: repo1: 10-2 no archive to remove\n"
"P00 INFO: repo1: remove expired backup history path 2017\n"
"P00 INFO: repo1: remove expired backup history manifest 20181029-152138F_20181104-152138I.manifest.gz\n"
"P00 INFO: repo1: remove expired backup history manifest 20181029-152138F.manifest.gz");
@@ -1488,6 +1529,8 @@ testRun(void)
"2019/20191119-152138F.manifest.gz\n");
TEST_RESULT_LOG(
+ "P00 INFO: repo1: 9.4-1 no archive to remove\n"
+ "P00 INFO: repo1: 10-2 no archive to remove\n"
"P00 INFO: repo1: remove expired backup history path 2017\n"
"P00 INFO: repo1: remove expired backup history manifest 20181029-152138F.manifest.gz");
}
@@ -1707,7 +1750,8 @@ testRun(void)
"P00 INFO: repo1: expire full backup 20181119-152138F\n"
"P00 INFO: repo1: expire full backup 20181119-152800F\n"
"P00 INFO: repo1: remove expired backup 20181119-152800F\n"
- "P00 INFO: repo1: remove expired backup 20181119-152138F");
+ "P00 INFO: repo1: remove expired backup 20181119-152138F\n"
+ "P00 INFO: repo1: 10-2 remove archive, start = 000000010000000000000001, stop = 000000010000000000000005");
TEST_RESULT_STRLST_STR(
strLstSort(storageListP(
storageTest, strNewFmt("%s/%s/%s", strZ(archiveStanzaPath), "10-1", "0000000100000000")), sortOrderAsc),
@@ -1937,12 +1981,12 @@ testRun(void)
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152138F, start = 000000020000000000000001,"
" stop = 000000020000000000000001\n"
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152800F, start = 000000020000000000000002\n"
- "P00 DETAIL: repo1: 9.4-1 no archive to remove\n"
+ "P00 INFO: repo1: 9.4-1 no archive to remove\n"
"P00 DETAIL: repo1: 12-2 archive retention on backup 20181119-152850F, start = 000000010000000000000002,"
" stop = 000000010000000000000004\n"
"P00 DETAIL: repo1: 12-2 archive retention on backup 20181119-152900F, start = 000000010000000000000006\n"
- "P00 DETAIL: repo1: 12-2 remove archive, start = 000000010000000000000001, stop = 000000010000000000000001\n"
- "P00 DETAIL: repo1: 12-2 remove archive, start = 000000010000000000000005, stop = 000000010000000000000005");
+ "P00 INFO: repo1: 12-2 remove archive, start = 000000010000000000000001, stop = 000000010000000000000001\n"
+ "P00 INFO: repo1: 12-2 remove archive, start = 000000010000000000000005, stop = 000000010000000000000005");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire full and archive (no dependents)");
@@ -1970,11 +2014,11 @@ testRun(void)
"P00 INFO: repo1: expire adhoc backup 20181119-152138F\n"
"P00 INFO: repo1: remove expired backup 20181119-152138F\n"
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152800F, start = 000000020000000000000002\n"
- "P00 DETAIL: repo1: 9.4-1 remove archive, start = 000000020000000000000001, stop = 000000020000000000000001\n"
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000020000000000000001, stop = 000000020000000000000001\n"
"P00 DETAIL: repo1: 12-2 archive retention on backup 20181119-152850F, start = 000000010000000000000002,"
" stop = 000000010000000000000004\n"
"P00 DETAIL: repo1: 12-2 archive retention on backup 20181119-152900F, start = 000000010000000000000006\n"
- "P00 DETAIL: repo1: 12-2 no archive to remove");
+ "P00 INFO: repo1: 12-2 no archive to remove");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire latest and resumable");
@@ -2009,9 +2053,9 @@ testRun(void)
"P00 INFO: repo1: remove expired backup 20181119-152900F_20181119-153000I\n"
"P00 INFO: repo1: remove expired backup 20181119-152900F\n"
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152800F, start = 000000020000000000000002\n"
- "P00 DETAIL: repo1: 9.4-1 no archive to remove\n"
+ "P00 INFO: repo1: 9.4-1 no archive to remove\n"
"P00 DETAIL: repo1: 12-2 archive retention on backup 20181119-152850F, start = 000000010000000000000002\n"
- "P00 DETAIL: repo1: 12-2 no archive to remove");
+ "P00 INFO: repo1: 12-2 no archive to remove");
TEST_RESULT_STR(storageInfoP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")).linkDestination,
STRDEF("20181119-152850F"), "latest link updated");
TEST_RESULT_STRLST_STR(
@@ -2054,7 +2098,7 @@ testRun(void)
"P00 INFO: repo1: remove expired backup 20181119-152800F\n"
"P00 INFO: repo1: remove archive path " TEST_PATH "/repo/archive/db/9.4-1\n"
"P00 DETAIL: repo1: 12-2 archive retention on backup 20181119-152850F, start = 000000010000000000000002\n"
- "P00 DETAIL: repo1: 12-2 no archive to remove");
+ "P00 INFO: repo1: 12-2 no archive to remove");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("error on expire last full backup on disk");
@@ -2309,7 +2353,7 @@ testRun(void)
"P00 INFO: repo1: expire adhoc backup 20181119-152850F_20181119-152252D\n"
"P00 INFO: repo1: remove expired backup 20181119-152850F_20181119-152252D\n"
"P00 DETAIL: repo1: 12-2 archive retention on backup 20181119-152850F, start = 000000010000000000000002\n"
- "P00 DETAIL: repo1: 12-2 no archive to remove\n"
+ "P00 INFO: repo1: 12-2 no archive to remove\n"
"P00 WARN: repo2: expiring latest backup 20181119-152850F_20181119-152252D - the ability to perform"
" point-in-time-recovery (PITR) may be affected\n"
" HINT: non-default settings for 'repo2-retention-archive'/'repo2-retention-archive-type' (even in prior"
@@ -2317,7 +2361,7 @@ testRun(void)
"P00 INFO: repo2: expire adhoc backup 20181119-152850F_20181119-152252D\n"
"P00 INFO: repo2: remove expired backup 20181119-152850F_20181119-152252D\n"
"P00 DETAIL: repo2: 12-2 archive retention on backup 20181119-152850F, start = 000000010000000000000002\n"
- "P00 DETAIL: repo2: 12-2 no archive to remove");
+ "P00 INFO: repo2: 12-2 no archive to remove");
TEST_RESULT_STR(storageInfoP(storageRepoIdx(1), STRDEF(STORAGE_REPO_BACKUP "/latest")).linkDestination,
STRDEF("20181119-152850F"), "latest link updated, repo2");
@@ -2444,7 +2488,7 @@ testRun(void)
"P00 INFO: [DRY-RUN] repo1: expire time-based backup 20181119-152138F\n"
"P00 INFO: [DRY-RUN] repo1: remove expired backup 20181119-152138F\n"
"P00 DETAIL: [DRY-RUN] repo1: 9.4-1 archive retention on backup 20181119-152800F, start = 000000010000000000000004\n"
- "P00 DETAIL: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000003");
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000003");
strLstAddZ(argList, "--repo1-retention-archive=9999999");
harnessCfgLoad(cfgCmdExpire, argList);
@@ -2469,9 +2513,9 @@ testRun(void)
"P00 DETAIL: [DRY-RUN] repo1: 9.4-1 archive retention on backup 20181119-152800F_20181119-152155I,"
" start = 000000010000000000000007, stop = 000000010000000000000007\n"
"P00 DETAIL: [DRY-RUN] repo1: 9.4-1 archive retention on backup 20181119-152900F, start = 000000010000000000000009\n"
- "P00 DETAIL: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000003\n"
- "P00 DETAIL: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000005, stop = 000000010000000000000005\n"
- "P00 DETAIL: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000008, stop = 000000010000000000000008");
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000003\n"
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000005, stop = 000000010000000000000005\n"
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000008, stop = 000000010000000000000008");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("repo1-retention-archive-type=diff");
@@ -2500,10 +2544,10 @@ testRun(void)
" stop = 000000010000000000000009\n"
"P00 DETAIL: [DRY-RUN] repo1: 9.4-1 archive retention on backup 20181119-152900F_20181119-152600D,"
" start = 000000010000000000000011\n"
- "P00 DETAIL: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000003\n"
- "P00 DETAIL: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000005, stop = 000000010000000000000005\n"
- "P00 DETAIL: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000008, stop = 000000010000000000000008\n"
- "P00 DETAIL: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000010, stop = 000000010000000000000010");
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000003\n"
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000005, stop = 000000010000000000000005\n"
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000008, stop = 000000010000000000000008\n"
+ "P00 INFO: [DRY-RUN] repo1: 9.4-1 remove archive, start = 000000010000000000000010, stop = 000000010000000000000010");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("expire oldest full");
@@ -2522,7 +2566,7 @@ testRun(void)
TEST_RESULT_LOG(
"P00 INFO: repo1: remove expired backup 20181119-152138F\n"
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152800F, start = 000000010000000000000004\n"
- "P00 DETAIL: repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000003");
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000010000000000000001, stop = 000000010000000000000003");
//--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("newest backup - retention met but must keep one");
@@ -2539,7 +2583,7 @@ testRun(void)
"P00 INFO: repo1: remove expired backup 20181119-152800F_20181119-152152D\n"
"P00 INFO: repo1: remove expired backup 20181119-152800F\n"
"P00 DETAIL: repo1: 9.4-1 archive retention on backup 20181119-152900F, start = 000000010000000000000009\n"
- "P00 DETAIL: repo1: 9.4-1 remove archive, start = 000000010000000000000004, stop = 000000010000000000000008");
+ "P00 INFO: repo1: 9.4-1 remove archive, start = 000000010000000000000004, stop = 000000010000000000000008");
harnessLogLevelReset();
}
[parent: 5b332b22b508]