Re: Progress reporting for pg_verify_checksums

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Michael Banck <michael(dot)banck(at)credativ(dot)de>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Bernd Helmle <bernd(dot)helmle(at)credativ(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: Progress reporting for pg_verify_checksums
Date: 2018-12-25 11:04:16
Message-ID: alpine.DEB.2.21.1812251132230.32444@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2018-12-25 11:12:43 Re: Progress reporting for pg_verify_checksums
Previous Message rajan 2018-12-25 10:20:23 Is there any way that one of the Postgres Background/Utility process may go down?