Re: Page Checksums + Double Writes - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Page Checksums + Double Writes
Date
Msg-id CA+U5nM+dYVybhyk+4jXSGkx6XEAitJZ+Von_WD=Wed2gwBB+YA@mail.gmail.com
Whole thread Raw
In response to Re: Page Checksums + Double Writes  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Page Checksums + Double Writes
List pgsql-hackers
On Wed, Dec 21, 2011 at 10:19 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Alvaro Herrera <alvherre@commandprompt.com> wrote:
>
>> If you get away with a new page format, let's make sure and
>> coordinate so that we can add more info into the header.  One
>> thing I wanted was to have an ID struct on each file, so that you
>> know what DB/relation/segment the file corresponds to.  So the
>> first page's special space would be a bit larger than the others.
>
> Couldn't that also be done by burning a bit in the page header
> flags, without a page layout version bump?  If that were done, you
> wouldn't have the additional information on tables converted by
> pg_upgrade, but you would get them on new tables, including those
> created by pg_dump/psql conversions.  Adding them could even be made
> conditional, although I don't know whether that's a good idea....

These are good thoughts because they overcome the major objection to
doing *anything* here for 9.2.

We don't need to use any flag bits at all. We add
PG_PAGE_LAYOUT_VERSION to the control file, so that CRC checking
becomes an initdb option. All new pages can be created with
PG_PAGE_LAYOUT_VERSION from the control file. All existing pages must
be either the layout version from this release (4) or the next version
(5). Page validity then becomes version dependent.

pg_upgrade still works.

Layout 5 is where we add CRCs, so its basically optional.

We can also have a utility that allows you to bump the page version
for all new pages, even after you've upgraded, so we may end with a
mix of page layout versions in the same relation. That's more
questionable but I see no problem with it.

Do we need CRCs as a table level option? I hope not. That complicates
many things.

All of this allows us to have another more efficient page version (6)
in future without problems, so its good infrastructure.

I'm now personally game on to make something work here for 9.2.

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


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Page Checksums
Next
From: Tom Lane
Date:
Subject: Re: Page Checksums + Double Writes