Re: Enabling Checksums - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Enabling Checksums
Date
Msg-id 904.1352843291@sss.pgh.pa.us
Whole thread Raw
In response to Re: Enabling Checksums  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Enabling Checksums  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Hmm... what if we took this a step further and actually stored the
> checksums in a separate relation fork?  That would make it pretty
> simple to support enabling/disabling checksums for particular
> relations.  It would also allow us to have a wider checksum, like 32
> or 64 bits rather than 16.  I'm not scoffing at a 16-bit checksum,
> because even that's enough to catch a very high percentage of errors,
> but it wouldn't be terrible to be able to support a wider one, either.

What happens when you get an I/O failure on the checksum fork?  Assuming
you're using 8K pages there, that would mean you can no longer verify
the integrity of between one and four thousand pages of data.

Not to mention the race condition problems associated with trying to be
sure the checksum updates hit the disk at the same time as the data-page
updates.

I think you really have to store the checksums *with* the data they're
supposedly protecting.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH] Patch to compute Max LSN of Data Pages
Next
From: Alvaro Herrera
Date:
Subject: Re: foreign key locks