Re: Checkpoint cost, looks like it is WAL/CRC - Mailing list pgsql-hackers

From Kenneth Marshall
Subject Re: Checkpoint cost, looks like it is WAL/CRC
Date
Msg-id 20050707154903.GB11899@it.is.rice.edu
Whole thread Raw
In response to Re: Checkpoint cost, looks like it is WAL/CRC  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Jul 07, 2005 at 11:36:40AM -0400, Tom Lane wrote:
> Greg Stark <gsstark@mit.edu> writes:
> > Tom Lane <tgl@sss.pgh.pa.us> writes:
> >> What we *could* do is calculate a page-level CRC and
> >> store it in the page header just before writing out.  Torn pages
> >> would then manifest as a wrong CRC on read.  No correction ability,
> >> but at least a reliable detection ability.
> 
> > At the same time as you do the CRC you can copy the bytes to a fresh page
> > skipping the LSNs. Likewise, when writing out the page you have to calculate
> > the CRC; at the same time as you calculate the CRC you write out the bytes to
> > a temporary buffer adding LSNs and write that to disk.
> 
> Huh?  You seem to be proposing doing *both* things, which sounds entirely
> pointless.
> 
> BTW, I was envisioning the page CRCs as something we'd only check during
> crash recovery, not normal-operation reads.
> 
>             regards, tom lane
> 
Does the DB page on disk have a version number? If so, maybe we could
update the WAL with the CRC+version anytime the page is update. You may
need to check the log for multiple CRC+version entries to determine the
torn-page status.

Ken


pgsql-hackers by date:

Previous
From: Darren Alcorn
Date:
Subject: Re: SQL99 - Nested Tables
Next
From: "Joshua D. Drake"
Date:
Subject: 8.1dev ssl broke?