Re: Logical to physical page mapping - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Logical to physical page mapping
Date
Msg-id 25570.1351371465@sss.pgh.pa.us
Whole thread Raw
In response to Re: Logical to physical page mapping  (Claudio Freire <klaussfreire@gmail.com>)
List pgsql-hackers
Claudio Freire <klaussfreire@gmail.com> writes:
> On Sat, Oct 27, 2012 at 3:41 PM, Heikki Linnakangas
> <hlinnakangas@vmware.com> wrote:
>>> I think you're just moving the atomic-write problem from the data pages
>>> to wherever you keep these pointers.

>> If the pointers are stored as simple 4-byte integers, you probably could
>> assume that they're atomic, and won't be torn.

> That could backfire.

Yeah, the potential loss in resiliency is scary.  Assume for the sake of
argument that we're storing these indirection pointers in 8K pages, 2000
or so to the page.  If you get a read failure on a regular heap page,
you've lost 8K worth of data.  If you get a read failure on an
indirection page, you've lost 16MB worth.  (Though perhaps the pointers
could be reconstructed, given additional overhead data on each regular
heap page; but that wouldn't be very cheap.)  Also, the write traffic
on a pointer page is 2000X as much as it is on an average heap page,
offering 2000X the opportunities for the disk hardware to drop a bit,
or for SSD storage to wear down, etc.  (Perhaps it's not that bad for
typical access patterns, but then again perhaps it's worse, given the
already noted strict requirements for write ordering.)  So it seems like
there'd be a rather nasty magnification of consequences for hardware
errors.

You've also got something like a 2000X concentration of access
contention for pointer pages compared to regular pages.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Claudio Freire
Date:
Subject: Re: Logical to physical page mapping
Next
From: Gavin Flower
Date:
Subject: Re: Logical to physical page mapping