Re: Do we need to handle orphaned prepared transactions in the server?

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Do we need to handle orphaned prepared transactions in the server?
Date: 2020-01-22 07:10:30
Message-ID: d5ee5dde-34b9-16d4-0074-60689627442c@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-01-22 07:17:48 Re: [HACKERS] Block level parallel vacuum
Previous Message Andrew Dunstan 2020-01-22 07:02:01 Re: ssl passphrase callback