Re: Progress reporting for pg_verify_checksums - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: Progress reporting for pg_verify_checksums
Date
Msg-id alpine.DEB.2.21.1812251132230.32444@lancre
Whole thread Raw
In response to Re: Progress reporting for pg_verify_checksums  (Michael Banck <michael.banck@credativ.de>)
Responses Re: Progress reporting for pg_verify_checksums
List pgsql-hackers
Hallo Michael,

> V5 attached.

Patch applies cleanly, compiles, global & local make check are ok.

Given that the specific output is not checked, I do not think that the -P 
check deserves a test on its own, I think that the -P option could simply 
be added to any of the existing tests.

I'm still unhappy that "kB" is used for 1024 bytes in the output, contrary 
to all existing standards (1 kB = 1000 bytes -- SI, 1 KB = 1 KiB = 1024 
bytes -- IEC & JEDEC). The fact that this is also used wrongly elsewhere 
in pg is not relevant, these are bugs to be fixed, not to be replicated.

Given the speed of verifying checksums and its storage-oriented status, I 
also still think that a (possibly fractional) MB (1,000,000 bytes), or 
even GB, is the right unit to use for reporting this progress. On my 
laptop (SSD), verifying runs at least at 1.26 GB/s (on one small test), 
there is no point in displaying kilobytes progress.

I still think that using a more precise time than time(), eg with existing 
macros from "instr_time.h", would not cost anything more and result in a 
better precision output. It would also allow to remove the check used to 
avoid a division-by-zero by switching to double.

If the check is performed while online (other patch in queue), then the 
size may change thus it may not reach or go beyond 100%. No big deal.

I'd consider inverting the sizeonly boolean, so that true does the check 
and false does only the size collection. It seems more logical to me if it 
performs more with true than with false.

-- 
Fabien.


pgsql-hackers by date:

Previous
From: rajan
Date:
Subject: Is there any way that one of the Postgres Background/Utilityprocess may go down?
Next
From: Fabien COELHO
Date:
Subject: Re: Progress reporting for pg_verify_checksums