Re: Deriving Recovery Snapshots

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Deriving Recovery Snapshots
Date: 2008-10-22 20:47:02
Message-ID: 1224708422.27145.484.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Wed, 2008-10-22 at 22:38 +0300, Heikki Linnakangas wrote:
> Simon Riggs wrote:
> > If you don't mark subtrans, you will need to keep things in shared
> > memory. I agree you can defer marking subtrans until your shared memory
> > fills, but you will still need to keep track of the parent for each
> > subtransaction until you do. If you don't *know* the parent, how will
> > you do this? You haven't explained how you will write the relationship
> > between a subtransaction and its parent into WAL, for each
> > subtransaction and for an arbitrarily large number of subtransactions.
>
> I was thinking that it's done in AssignTransactionId(). Similarly to
> what you're doing in your patch, but instead of just one xid with it's
> parent, a list of (xid, parent) pairs would be stored in the WAL record.

> Upon replaying that WAL record, those parent-child relationships are
> recorded in subtrans, and the child xids are removed from UnobservedXids.

But once you reach 64 transactions, you'll need to write an extra WAL
record for every subtransaction, which currently I've managed to avoid.

I understand what you hope to achieve, but right now my focus is on
achieving correctness within next few days, not on reworking parts of
the patch that seem to work correctly and are reasonably well optimised.
We can discuss rework in more detail in a couple of weeks. It's been a
worthwhile discussion, but lets look somewhere else now. I could really
use your help in thinking about prepared transactions.

Forgive me please, I don't wish to be rude, though I probably am.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-10-22 20:58:03 Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.
Previous Message Tom Lane 2008-10-22 20:41:36 Re: [COMMITTERS] pgsql: Rework subtransaction commit protocol for hot standby.