Re: [PATCH] Add prepared_orphaned_transaction_timeout GUC

From: Nikhil Chawla <chawlanikhil24(at)gmail(dot)com>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Add prepared_orphaned_transaction_timeout GUC
Date: 2026-03-26 07:32:23
Message-ID: CAAXajwD5pT+BtQqLTn=6DDs8NAWgqm4S6esSn0Zr3Ev1kVbYPg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Andrey,

My purview is absolutely influenced from "long running transactions" which
are essentially killed by pg itself through idle_session_timeout. This also
happens when the user sets an acceptable value to this timeout and the user
is aware that transactions can be killed if threshold is exceeded, which
further can be confirmed through logs.

The same analogy is being applied with orphaned prepared transactions,
which may/may not complete ever , but going to hinder autovacuum,
increasing bloat. When user sets the value, user will be aware that the
prepared transactions can disappear automatically.

On Wed, Mar 25, 2026 at 2:36 PM Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote:

>
>
> > On 23 Mar 2026, at 16:47, Nikhil Chawla <chawlanikhil24(at)gmail(dot)com>
> wrote:
> >
> > idle_in_transaction_session_timeout, idle_session_timeout,
> statement_timeout, but no equivalent for prepared transactions
>
> During implementation of the transaction_timeout we briefly considered
> prepared xacts, but decided that it's a footgun.
>
> DBA can easily do the same with a cron job, but in case of prepared
> transactions monitoring is crucial. Prepared xacts are used to coordinate
> commit in many durable systems and orphan prepared xact is evidence of
> serious malfunction.
>
> Silent rollback in any scenario I can imagine is a disaster.
>
>
> Best regards, Andrey Borodin.

--
Regards,
Nikhil Chawla
Twitter <https://twitter.com/chawlanikhil24> | LinkedIn
<http://linkedin.com/in/chawlanikhil24>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Sharma 2026-03-26 07:48:43 Re: synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication
Previous Message Ashutosh Bapat 2026-03-26 07:08:50 Re: SQL Property Graph Queries (SQL/PGQ)