Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-performancepgsql-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

pgsql-performance by date

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

pgsql-www by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group