v8-0009-Refactor-move-first-and-last-progress_report-call.patch
application/x-patch
Filename: v8-0009-Refactor-move-first-and-last-progress_report-call.patch
Type: application/x-patch
Part: 1
Patch
Format: format-patch
Series: patch v8-0009
Subject: Refactor: move first and last progress_report call to Main.
| File | + | − |
|---|---|---|
| src/bin/pg_verifybackup/pg_verifybackup.c | 6 | 4 |
From 83357e1fcccb433a5e4c343232f66431998e9e59 Mon Sep 17 00:00:00 2001
From: Amul Sul <amul.sul@enterprisedb.com>
Date: Fri, 2 Aug 2024 16:37:38 +0530
Subject: [PATCH v8 09/12] Refactor: move first and last progress_report call
to Main.
The progress_report() is currently called at the start and end of
verify_backup_checksums(), which is used only for plain backups. Since
we also need to report progress for TAR backups, the progress_report()
has been moved from verify_backup_checksums() to a common
location.
---
src/bin/pg_verifybackup/pg_verifybackup.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c
index d518f995298..cb4094c8138 100644
--- a/src/bin/pg_verifybackup/pg_verifybackup.c
+++ b/src/bin/pg_verifybackup/pg_verifybackup.c
@@ -253,7 +253,10 @@ main(int argc, char **argv)
* read, which occurs only when checksum verification is enabled.
*/
if (!context.skip_checksums)
+ {
compute_total_size(&context);
+ progress_report(&context, false);
+ }
/*
* Now scan the files in the backup directory. At this stage, we verify
@@ -275,7 +278,10 @@ main(int argc, char **argv)
* told to skip it.
*/
if (!context.skip_checksums)
+ {
verify_backup_checksums(&context);
+ progress_report(&context, true);
+ }
/*
* Try to parse the required ranges of WAL records, unless we were told
@@ -736,8 +742,6 @@ verify_backup_checksums(verifier_context *context)
manifest_file *m;
uint8 *buffer;
- progress_report(context, false);
-
buffer = pg_malloc(READ_CHUNK_SIZE * sizeof(uint8));
manifest_files_start_iterate(manifest->files, &it);
@@ -761,8 +765,6 @@ verify_backup_checksums(verifier_context *context)
}
pfree(buffer);
-
- progress_report(context, true);
}
/*
--
2.18.0