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

From Bruce Momjian
Subject Re: Two-phase commit
Date
Msg-id 200402080138.i181cPl15259@candle.pha.pa.us
Whole thread Raw
In response to Two-phase commit  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Two-phase commit
List pgsql-hackers
Heikki Linnakangas wrote:
> I've been very slowly continuing my work on two-phase commits for a couple
> months now, and I now have my original patch updated so that it applies to
> the current CVS tip, with some improvements.
> 
> The patch introduces three new commands, PREPCOMMIT, COMMITPREPARED and
> ABORTPREPARED.
> 
> To start a 2PC transaction, you first do a BEGIN and your updates as
> usual. At the end of the transaction, you call PREPCOMMIT 'foobar' instead
> of COMMIT. Now the transaction is in prepared state, ready to commit at a
> later time. 'foobar' is the global transaction identifier assigned for the
> transaction.
> 
> Later, when you want to finish the second phase, you call
> COMMITPREPARED 'foobar';
> 
> There is a system view pg_prepared_xacts that gives you all transactions
> that are in prepared state waiting for COMMITPREPARED or ABORTPREPARED.
> 
> I have also done some work on XA-enabling the JDBC drivers, now that we
> have what it takes in the server side. I have succesfully executed
> 2PC transactions with JBossMQ and Postgres, using JBoss as the
> transaction manager, so the basic stuff seems to be working.
> 
> Please have a look and comment, the patches can be found here:
> http://www.iki.fi/hlinnaka/pgsql/
> 
> What is the schedule for 7.5? Any chance of getting this in?

7.5 is certainly possible.  We are months away from beta on 7.5 and I
would like ot see two-phase commit included.  One item that has come up
in past discussions is a way of recording two-phase commit failures to
the administrator in cases where you precommit, get a reply, commit,
then the remote machine disappears.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PITR Dead horse?
Next
From: Bruce Momjian
Date:
Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint