Re: [HACKERS] Online enabling of page level checksums - Mailing list pgsql-hackers

From Greg Stark
Subject Re: [HACKERS] Online enabling of page level checksums
Date
Msg-id CAM-w4HM-DhiBh1hFdk5DbySgp1ywKMuP8gjvaSijQ2qKDS90Ow@mail.gmail.com
Whole thread Raw
In response to [HACKERS] Online enabling of page level checksums  (Magnus Hagander <magnus@hagander.net>)
Responses Re: [HACKERS] Online enabling of page level checksums  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers


On Jan 22, 2017 11:13 AM, "Magnus Hagander" <magnus@hagander.net> wrote:

Yes, this means the entire db will end up in the transaction log since everything is rewritten. That's not great, but for a lot of people that will be a trade they're willing to make since it's a one-time thing. Yes, this background process might take days or weeks - that's OK as long as it happens online.

I'm not sure that's actually necessary. You could just log a wal record saying "checksum this block" and if it gets replayed then recalculate the checksum on that block again. This record could be exempt from the usual rules for having a fpw.

There's no danger of torn pages from the checksum alone. The danger would be if some other operation does dirty that page then your need to know that the page is in this weird in between state where it's dirty but not yet had a fpw written. 

I'm not sure whether it's worth the infrastructure to have such a state just for this or not. On the other hand it sounds like something that would be useful.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Undefined psql variables
Next
From: Corey Huinker
Date:
Subject: Re: [HACKERS] Undefined psql variables