Re: Online verification of checksums - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: Online verification of checksums
Date
Msg-id CABUevEyvhjRbcARcd51HPMsVipEvopU-qo9bS21yrryhPvjSyw@mail.gmail.com
Whole thread Raw
In response to Re: Online verification of checksums  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On Thu, Aug 30, 2018 at 8:06 PM, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
On 26/07/2018 13:59, Michael Banck wrote:
> I've now forward-ported this change to pg_verify_checksums, in order to
> make this application useful for online clusters, see attached patch.

Why not provide this functionality as a server function or command.
Then you can access blocks with proper locks and don't have to do this
rather ad hoc retry logic on concurrent access.

I think it would make sense to provide this functionality in the "checksum worker" infrastruture suggested in the online checksum enabling patch. But I think being able to run it from the outside would also be useful, particularly when it's this simple.

But why do we need a sleep in it? AFAICT this is basically the same code that we have in basebackup.c, and that one does not need the sleep? Certainly 500ms would be very long since we're just protecting against a torn page, but the comment is wrong I think, and we're actually sleeping 0.5ms?

--

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #15346: Replica fails to start after the crash
Next
From: Pavel Stehule
Date:
Subject: Re: Proposal for disk quota feature