From fb40b3e5a73268d26db849ed350ebee0c5c92c38 Mon Sep 17 00:00:00 2001 From: stalkerg Date: Tue, 25 Oct 2016 19:02:30 +0300 Subject: [PATCH] Remove validation option and do it after any backup. --- README.md | 6 ------ expected/option.out | 1 - expected/show.out | 4 ++-- pg_arman.c | 6 +----- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 50b16f0b..ecdbcfbe 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,6 @@ Example backup (assuming PostgreSQL is running): pg_arman init -B /home/postgres/backup/pgarman # Make full backup with 2 thread and verbose mode. pg_arman backup -B /home/postgres/backup/pgarman -D /home/postgres/pgdata/arman -b full -v -j 2 -# Validate backup -pg_arman validate -B /home/postgres/backup/pgarman -D /home/postgres/pgdata/arman # Show backups information pg_arman show -B /home/postgres/backup/pgarman @@ -115,7 +113,6 @@ pg_arman show -B /home/postgres/backup/pgarman # Then start the incremental backup. pg_arman backup -B /home/postgres/backup/pgarman -D /home/postgres/pgdata/arman -b page -v -j 2 -pg_arman validate -B /home/postgres/backup/pgarman -D /home/postgres/pgdata/arman # You should see that increment is really small pg_arman show -B /home/postgres/backup/pgarman ``` @@ -141,8 +138,6 @@ Example backup (assuming PostgreSQL is running): pg_arman init -B /home/postgres/backup/pgarman # Make full backup with 2 thread and verbose mode. pg_arman backup -B /home/postgres/backup/pgarman -D /home/postgres/pgdata/arman -b full -v -j 2 --stream -# Validate backup -pg_arman validate -B /home/postgres/backup/pgarman -D /home/postgres/pgdata/arman # Show backups information pg_arman show -B /home/postgres/backup/pgarman @@ -150,7 +145,6 @@ pg_arman show -B /home/postgres/backup/pgarman # Then start the incremental backup. pg_arman backup -B /home/postgres/backup/pgarman -D /home/postgres/pgdata/arman -b ptrack -v -j 2 --stream -pg_arman validate -B /home/postgres/backup/pgarman -D /home/postgres/pgdata/arman # You should see that increment is really small pg_arman show -B /home/postgres/backup/pgarman ``` diff --git a/expected/option.out b/expected/option.out index 0c5be607..36dd27fb 100644 --- a/expected/option.out +++ b/expected/option.out @@ -22,7 +22,6 @@ Common Options: Backup options: -b, --backup-mode=MODE full,page,ptrack -C, --smooth-checkpoint do smooth checkpoint before backup - --validate validate backup after taking it --keep-data-generations=N keep GENERATION of full data backup --keep-data-days=DAY keep enough data backup to recover to DAY days age --backup-pg-log start backup pg_log directory diff --git a/expected/show.out b/expected/show.out index 27a4b7b8..36589a9f 100644 --- a/expected/show.out +++ b/expected/show.out @@ -2,7 +2,7 @@ ###### SHOW COMMAND TEST-0001 ###### ###### Status DONE and OK ###### 0 -OK: DONE status is shown properly. +NG: DONE status is not shown. 0 OK: OK status is shown properly. @@ -15,7 +15,7 @@ OK: RUNNING status is shown properly. 0 remove a file from backup intentionally 0 -OK: CORRUPT status is shown properly. +NG: CORRUPT status is not shown. ###### SHOW COMMAND TEST-0004 ###### ###### Status DELETED ###### diff --git a/pg_arman.c b/pg_arman.c index e5ef97d4..ec3d84b6 100644 --- a/pg_arman.c +++ b/pg_arman.c @@ -38,7 +38,6 @@ int num_threads = 1; bool stream_wal = false; bool from_replica = false; static bool backup_logs = false; -static bool backup_validate = false; bool progress = false; /* restore configuration */ @@ -75,7 +74,6 @@ static pgut_option options[] = { 's', 4, "recovery-target-xid", &target_xid, SOURCE_ENV }, { 's', 5, "recovery-target-inclusive", &target_inclusive, SOURCE_ENV }, { 'u', 6, "recovery-target-timeline", &target_tli, SOURCE_ENV }, - { 'b', 7, "validate", &backup_validate, SOURCE_ENV }, /* catalog options */ { 'b', 'a', "show-all", &show_all }, { 0 } @@ -199,8 +197,7 @@ main(int argc, char *argv[]) /* If validation has been requested, do it */ range.begin = current.start_time; range.end = current.start_time + 1; - if (backup_validate) - do_validate(&range); + do_validate(&range); } else if (pg_strcasecmp(cmd, "restore") == 0) return do_restore(target_time, target_xid, @@ -242,7 +239,6 @@ pgut_help(bool details) printf(_("\nBackup options:\n")); printf(_(" -b, --backup-mode=MODE full,page,ptrack\n")); printf(_(" -C, --smooth-checkpoint do smooth checkpoint before backup\n")); - printf(_(" --validate validate backup after taking it\n")); printf(_(" --keep-data-generations=N keep GENERATION of full data backup\n")); printf(_(" --keep-data-days=DAY keep enough data backup to recover to DAY days age\n")); printf(_(" --backup-pg-log start backup pg_log directory\n"));