v7-0009-Refactor-move-first-and-last-progress_report-call.patch
application/x-patch
Filename: v7-0009-Refactor-move-first-and-last-progress_report-call.patch
Type: application/x-patch
Part: 4
Patch
Format: format-patch
Series: patch v7-0009
Subject: Refactor: move first and last progress_report call to Main.
| File | + | − |
|---|---|---|
| src/bin/pg_verifybackup/pg_verifybackup.c | 6 | 4 |
From ee279a6a540a640857599951807438cda02f30d6 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 v7 09/12] Refactor: move first and last progress_report call
to Main.
---
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 5f055a23a63..801e13886c2 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