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

From Thomas Kellerer
Subject Re: Do we need to handle orphaned prepared transactions in theserver?
Date
Msg-id d5ee5dde-34b9-16d4-0074-60689627442c@gmx.net
Whole thread Raw
In response to Do we need to handle orphaned prepared transactions in the server?  (Hamid Akhtar <hamid.akhtar@gmail.com>)
List pgsql-hackers
> First and foremost is to define what an orphaned transaction is. At
> this stage, I believe any prepared transaction that has been there
> for more than X time may be considered as an orphan. X may be defined
> as an integer in seconds (a GUC perhaps). May be there are better
> ways to define this. Please feel free to chime in.


What about specifying a timeout when starting the prepared transaction?

I can imagine situations where a timeout of hours might be needed/anticipated
(e.g. really slow external systems) and situations where the developer
knows that the other systems are never slower than a few seconds.

Something like:

   prepare transaction 42 timeout interval '2 days';

or

   prepare transaction 42 timeout interval '30 second';

Or maybe even with a fixed timestamp instead of an interval?

   prepare transaction 42 timeout timestamp '2020-01-30 14:00:00';

Thomas



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: ssl passphrase callback
Next
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] Block level parallel vacuum