Re: Block-level CRC checks - Mailing list pgsql-hackers

From Aidan Van Dyk
Subject Re: Block-level CRC checks
Date
Msg-id 20081002181034.GC16893@yugib.highrise.ca
Whole thread Raw
In response to Re: Block-level CRC checks  ("Jonah H. Harris" <jonah.harris@gmail.com>)
List pgsql-hackers
* Jonah H. Harris <jonah.harris@gmail.com> [081002 14:01]:
> On Thu, Oct 2, 2008 at 1:58 PM, Gregory Stark <stark@enterprisedb.com> wrote:
> >> On recovery after a torn-page write, won't the recovery of the
> >> full_page_write WAL + WAL changes get us back to the page as it was
> >> before the buffer+checksum+write?
> >
> > Hint bit setting doesn't trigger a WAL record.
> 
> Hence, no page image is written to WAL for later use in recovery.

OK.  Got it...  The block is dirty (only because of hint bits).  write
starts, crash, torn page, recovery doesn't "fix" the torn page...
because it's never been changed (according WAL), so on next read...

Without the CRC it doesn't matter, because the only change was
hint-bits, so the page is half-old+half-new, but new == old+only
hint-bits...

Because ther'es no WAP. the torn page will be read next time that buffer
is needed...

a.

-- 
Aidan Van Dyk                                             Create like a god,
aidan@highrise.ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.

pgsql-hackers by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: Block-level CRC checks
Next
From: Heikki Linnakangas
Date:
Subject: Re: FSM rewrite committed, loose ends