Re: BBU Cache vs. spindles

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Bruce Momjian <bruce(at)momjian(dot)us>, jd(at)commandprompt(dot)com, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, Steve Crawford <scrawford(at)pinpointresearch(dot)com>, pgsql-performance(at)postgresql(dot)org, Ben Chobot <bench(at)silentmedia(dot)com>
Subject: Re: BBU Cache vs. spindles
Date: 2010-10-22 04:05:27
Message-ID: 13038.1287720327@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance pgsql-www

Greg Smith <greg(at)2ndquadrant(dot)com> writes:
> At this point, you now have a torn 8K page, with 1/2 old and 1/2 new
> data.

Right.

> Without a full page write in the WAL, is it always possible to
> restore its original state now? In theory, I think you do. Since the
> delta in the WAL should be overwriting all of the bytes that changed
> between the old and new version of the page, applying it on top of any
> four possible states here:

You've got entirely too simplistic a view of what the "delta" might be,
I fear. In particular there are various sorts of changes that involve
inserting the data carried in the WAL record and shifting pre-existing
data around to make room, or removing an item and moving remaining data
around. If you try to replay that type of action against a torn page,
you'll get corrupted results.

We could possibly redefine the WAL records so that they weren't just the
minimum amount of data but carried every byte that'd changed on the
page, and then I think what you're envisioning would work. But the
records would be a lot bulkier. It's not clear to me that this would be
a net savings over the current design, particularly not if there's
a long interval between checkpoints.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2010-10-22 04:06:21 Re: BBU Cache vs. spindles
Previous Message Greg Smith 2010-10-22 03:47:24 Re: BBU Cache vs. spindles

Browse pgsql-www by date

  From Date Subject
Next Message Greg Smith 2010-10-22 04:06:21 Re: BBU Cache vs. spindles
Previous Message Greg Smith 2010-10-22 03:47:24 Re: BBU Cache vs. spindles