Re: Do we need to handle orphaned prepared transactions in the server? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Do we need to handle orphaned prepared transactions in the server?
Date
Msg-id 6434.1579705539@sss.pgh.pa.us
Whole thread Raw
In response to Re: Do we need to handle orphaned prepared transactions in the server?  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Do we need to handle orphaned prepared transactions in theserver?  (Thomas Kellerer <shammat@gmx.net>)
List pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> So I don't really see the point of doing anything with 2PC xacts
> within Pg proper. It's the job of the app that prepares the 2PC xacts,
> and if that app is unable to resolve them for some reason there's no
> generally-correct action to take without administrator action.

Right.  It's the XA transaction manager's job not to forget uncommitted
transactions.  Reasoning as though no TM exists is not only not very
relevant, but it might lead you to put in features that actually
make the TM's job harder.  In particular, a timeout (or any other
mechanism that leads PG to abort or commit a prepared transaction
of its own accord) does that.

Or another way to put it: the fundamental premise of a prepared
transaction is that it will be possible to commit it on-demand with
extremely low chance of failure.  Designing in a reason why we'd
fail to be able to do that would be an anti-feature.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: We're getting close to the end of 2020-01 CF
Next
From: Thomas Kellerer
Date:
Subject: Re: Do we need to handle orphaned prepared transactions in theserver?