Re: Deriving Recovery Snapshots - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Deriving Recovery Snapshots
Date
Msg-id 1224687014.27145.340.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: Deriving Recovery Snapshots  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Wed, 2008-10-22 at 17:29 +0300, Heikki Linnakangas wrote:
> Simon Riggs wrote:

> > You may be missing my point.
> > 
> > We need an initial state to work from.
> > 
> > I am proposing we write a full snapshot after each checkpoint because it
> > allows us to start recovery again from that point. If we wrote only
> > OldestXmin as you suggest it would optimise the size of the WAL record
> > but it would prevent us from restarting at that point.
> 
> Well, you'd just need to treat anything > oldestxmin, and not marked as 
> finished in clog, as unobserved. Which doesn't seem too bad. Not that 
> storing the full list of in-progress xids is that bad either, though.

As I said, I'm storing the whole list to give me an initial state.

> Hmm. What about in-progress subtransactions that have overflowed the 
> shared mem cache? Can we rely that subtrans is up-to-date, up to the 
> checkpoint record that recovery starts from?

Yes, we can't use snapshots as an initial state if they have overflowed.
In that case we could avoid dropping full snapshot to WAL, yes. That's
probably trivial to implement.

Currently, the patch can start from a non-overflowed snapshot, but it
could also start from an overflowed snapshot and wait until we receive a
snapshot with an xmin > the xmax of the first snapshot. That seemed too
much icing for the first patch. I think we need to all agree on the
correctness aspects before we attempt too much tuning and tweaking.

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: "Jaime Casanova"
Date:
Subject: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1
Next
From: Simon Riggs
Date:
Subject: Re: Deriving Recovery Snapshots