Re: Online enabling of checksums

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: Online enabling of checksums
Date: 2018-02-25 14:54:50
Message-ID: CABUevEx4Gvm3N6LzCv2yfCHdyY7j=UzYR_g_8SthxagMq6ZsGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 25, 2018 at 1:21 AM, Greg Stark <stark(at)mit(dot)edu> wrote:

> > The change of the checksum state is WAL logged with a new xlog record.
> All the buffers written by the background worker are forcibly enabled full
> page writes to make sure the checksum is fully updated on the standby even
> if no actual contents of the buffer changed.
>
> Hm. That doesn't sound necessary to me. If you generate a checkpoint
> (or just wait until a new checkpoint has started) then go through and
> do a normal xlog record for every page (any xlog record, a noop record
> even) then the normal logic for full page writes ought to be
> sufficient. If the noop record doesn't need a full page write it's
> because someone else has already come in and done one and that one
> will set the checksum. In fact if any page has an lsn > the checkpoint
> start lsn for the checkpoint after the flag was flipped then you
> wouldn't need to issue any record at all.
>

What would be the actual benefit though? We'd have to invent a noop WAL
record, and just have some other part of the system do the full page write?
So why not just send the full page in the first place?

Also if that wasn't clear -- we only do the full page write if there isn't
already a checksum on the page and that checksum is correct.

(We do trigger a checkpoint at the end, and wait for it to complete)

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2018-02-25 14:57:01 Re: Online enabling of checksums
Previous Message Michail Nikolaev 2018-02-25 13:54:18 Re: New gist vacuum.