Re: CRCs - Mailing list pgsql-hackers

From ncm@zembu.com (Nathan Myers)
Subject Re: CRCs
Date
Msg-id 20010112145445.W571@store.zembu.com
Whole thread Raw
In response to RE: CRCs  ("Mikheev, Vadim" <vmikheev@SECTORBASE.COM>)
Responses Re: CRCs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jan 12, 2001 at 02:16:07PM -0800, Mikheev, Vadim wrote:
> > > You know - this is *core* assumption. If drive lies about this then
> > > *nothing* will help you. Do you remember core rule of WAL?
> > > "Changes must be logged *before* changed data pages written".
> > > If this rule will be broken then data files will be inconsistent
> > > after crash recovery and you will not notice this, w/wo CRC in
> > > data blocks.
> > 
> > You can include the data blocks' CRCs in the log entries.
> 
> How could it help?

It wouldn't help you recover, but you would be able to report that 
you cannot recover.

To be more specific, if the blocks referenced in the log are partially 
written, their CRCs will (probably) be wrong.  If they are not 
physically written at all, their CRCs will be correct but will 
not match what is in the log.  In either case the user will know 
immediately that the database has been corrupted, and must fall 
back on a failover image or backup.

It would be no bad thing to include the CRC of the block referenced
wherever in the file format that a block reference lives.

Nathan Myers
ncm@zembu.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CVS updates on committers list...
Next
From: Ian Lance Taylor
Date:
Subject: Re: CVS updates on committers list...