Re: 16-bit page checksums for 9.2

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: heikki(dot)linnakangas(at)enterprisedb(dot)com, aidan(at)highrise(dot)ca, stark(at)mit(dot)edu, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 16-bit page checksums for 9.2
Date: 2011-12-30 12:15:02
Message-ID: CA+U5nM+TxErg2HmsgHZKNi=X8ELRZ6_D+2rzX4EG8HCNX-hBxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 29, 2011 at 4:44 PM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
>> Heikki Linnakangas  wrote:
>> On 28.12.2011 01:39, Simon Riggs wrote:
>>> On Tue, Dec 27, 2011 at 8:05 PM, Heikki Linnakangas
>>>  wrote:
>>>> On 25.12.2011 15:01, Kevin Grittner wrote:
>>>>>
>>>>> I don't believe that. Double-writing is a technique to avoid
>>>>> torn pages, but it requires a checksum to work. This chicken-
>>>>> and-egg problem requires the checksum to be implemented first.
>>>>
>>>> I don't think double-writes require checksums on the data pages
>>>> themselves, just on the copies in the double-write buffers. In
>>>> the double-write buffer, you'll need some extra information per-
>>>> page anyway, like a relfilenode and block number that indicates
>>>> which page it is in the buffer.
>
> You are clearly right -- if there is no checksum in the page itself,
> you can put one in the double-write metadata.  I've never seen that
> discussed before, but I'm embarrassed that it never occurred to me.

Heikki's idea for double writes works well. It solves the problems of
torn pages in a way that would make FPW redundant.

However, I don't see that it provides protection across non-crash
write problems. We know we have these since many systems have run
without a crash for years and yet still experience corrupt data.

Double writes do not require page checksums but neither do they
replace page checksums.

So I think we need page checksums plus either FPWs or double writes.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-12-30 14:18:43 Re: 16-bit page checksums for 9.2
Previous Message Marko Kreen 2011-12-30 09:25:43 Re: [RFC] grants vs. inherited tables