fix_pg_checksums_progress_report_v2.patch
application/octet-stream
Filename: fix_pg_checksums_progress_report_v2.patch
Type: application/octet-stream
Part: 0
Message:
RE: Fix pg_checksums progress report
Patch
Format: unified
Series: patch v2
| File | + | − |
|---|---|---|
| src/bin/pg_checksums/pg_checksums.c | 6 | 1 |
diff --git a/src/bin/pg_checksums/pg_checksums.c b/src/bin/pg_checksums/pg_checksums.c
index 0223ee4408..2d078d8fbb 100644
--- a/src/bin/pg_checksums/pg_checksums.c
+++ b/src/bin/pg_checksums/pg_checksums.c
@@ -229,12 +229,17 @@ scan_file(const char *fn, BlockNumber segmentno)
}
blocks++;
+ /*
+ * The current_size is calculated before checking if header is a
+ * new page, because total_size includes the size of new pages.
+ */
+ current_size += r;
+
/* New pages have no checksum yet */
if (PageIsNew(header))
continue;
csum = pg_checksum_page(buf.data, blockno + segmentno * RELSEG_SIZE);
- current_size += r;
if (mode == PG_MODE_CHECK)
{
if (csum != header->pd_checksum)