Skip site navigation (1) Skip section navigation (2)

Re: Block-level CRC checks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Aidan Van Dyk <aidan(at)highrise(dot)ca>, Gregory Stark <stark(at)enterprisedb(dot)com>, pgsql(at)mohawksoft(dot)com, Hannu Krosing <hannu(at)2ndquadrant(dot)com>, "Decibel!" <decibel(at)decibel(dot)org>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Block-level CRC checks
Date: 2008-10-02 14:47:33
Message-ID: 29985.1222958853@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Andrew Chernow <ac(at)esilo(dot)com> writes:
> I read through this patch and am curious why 0xdeadbeef was used as an 
> uninitialized value for the page crc.  Is this value somehow less likely 
> to have collisons than zero (or any other arbitrary value)?

Actually, because that's a favorite bit pattern for programs to fill
unused memory with, I'd venture that it has measurably HIGHER odds
of being bogus than any other bit pattern.  Consider the possibility
that a database page got overwritten with someone's core dump.

> Would it not be better to add a boolean bit or byte to inidcate the crc 
> state?

No, as noted that would give you a one-in-two chance of incorrectly
skipping the CRC check, not one-in-2^32 or so.  If we're going to allow
a silent skip of the CRC check then a special value of CRC is a good way
to do it ... just not this particular one.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Jonah H. HarrisDate: 2008-10-02 14:48:32
Subject: Re: Block-level CRC checks
Previous:From: Tom LaneDate: 2008-10-02 14:41:20
Subject: Re: Block-level CRC checks

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group