Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2eb1fc8

Browse files
committed
pg_checksums: Fix progress reporting.
pg_checksums uses two counters, total size and current size,to calculate the progress. Previously the progress thatpg_checksums reported could not reach 100% at the end.The cause of this issue was that the sizes of only pages excludingnew ones in each file were counted as the current sizewhile the size of each file is counted as the total size.That is, the total size of all new pages could be reportedas the difference between the total size and current size.This commit fixes this issue by making pg_checksums countthe sizes of all pages including new ones in each file asthe current size.Back-patch to v12 where progress reporting was added to pg_checksums.Reported-by: Shinya KatoAuthor: Shinya KatoReviewed-by: Fujii MasaoDiscussion:https://postgr.es/m/TYAPR01MB289656B1ACA0A5E7CAD07BE3C47A9@TYAPR01MB2896.jpnprd01.prod.outlook.com
1 parent53aafdb commit2eb1fc8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/bin/pg_checksums/pg_checksums.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,19 @@ scan_file(const char *fn, BlockNumber segmentno)
229229
}
230230
blocks++;
231231

232+
/*
233+
* Since the file size is counted as total_size for progress status
234+
* information, the sizes of all pages including new ones in the file
235+
* should be counted as current_size. Otherwise the progress reporting
236+
* calculated using those counters may not reach 100%.
237+
*/
238+
current_size+=r;
239+
232240
/* New pages have no checksum yet */
233241
if (PageIsNew(header))
234242
continue;
235243

236244
csum=pg_checksum_page(buf.data,blockno+segmentno*RELSEG_SIZE);
237-
current_size+=r;
238245
if (mode==PG_MODE_CHECK)
239246
{
240247
if (csum!=header->pd_checksum)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp