Re: Two-phase commit - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Two-phase commit
Date
Msg-id 20041006233311.GA8221@dcc.uchile.cl
Whole thread Raw
In response to Re: Two-phase commit  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Two-phase commit
List pgsql-hackers
On Wed, Oct 06, 2004 at 05:46:10PM -0400, Tom Lane wrote:

> You were concerned about how to mark prepared transactions in pg_clog,
> given that Alvaro had already commandeered state '11' for
> subtransactions.  Since only a toplevel transaction can be prepared,
> it might work to allow state '11' with a zero pg_subtrans parent link
> to mean a prepared transaction.  This would imply factoring prepared
> XIDs into GlobalXmin (so that pg_subtrans entries don't get recycled
> too soon) but we probably have to do that anyway.  AFAICS, prepared
> but uncommitted XIDs have to be considered still InProgress, so if
> they are less than GlobalXmin we'd lose.

This seems to work.

I am concerned with a different issue: what issues arise regarding
snapshots?  Do concurrent xacts see a prepared one as running?  I'm not
sure but I think so.  So they have to be able to at least get its Xid,
no?

As soon as you have that stored somewhere, you have to ensure that an
arbitrary number of Xids, or better, snapshots, have to be somewhere.
The "100" concept does not impress me either.  So if you can have an
arbitrary number of snapshots, you can as well have an arbitrary number
of WITH HOLD open cursors, without the ugly Materialize node.

Am I right?

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Two-phase commit
Next
From: Oliver Jowett
Date:
Subject: Re: Two-phase commit