Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5sOJ-003iTH-20 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 21:37:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5sOI-005hIb-0c for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 21:37:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5fCn-001V66-0v for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 07:32:37 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5fCl-000000016ZF-3Tlf for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 07:32:36 +0000 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-35b905e9dc0so422647a91.3 for ; Thu, 26 Mar 2026 00:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774510355; cv=none; d=google.com; s=arc-20240605; b=Y4PXjrTLCDteRs5VwXHYMYf86EfSimzRp15/PfIhM/P+O3QdbnH8sFnKii7SOKxkif hAWNwHTeBqHnsDUfDFjPQwtggzcxFisZ1WQSRZyw/Jr3E53sLeeO6/UEk13LY4qVp+IE DIySMb0QQsZ5IwcdtnX4XRWIBIYtkH8m4aWsgJn/Y2MIhqvkrVg0fipD2OGNBL5rq3JM KLk8KuCi9pBce6Ar+tgeHd0b0layNt9hVCOTzVMzFrbEPyqgSLULhAS7zSjqaGAV0anw xdFD9mXmNvhzK/QPkPtezH9TB/ix0uJw7XqPMUOajm2WWhkL0qaQ7HLsGdi9HLpv2doc shNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=eM7S3YYXLh1P1o1wL1v+Pkq0TeVuiQARe4KNYXpkGWQ=; fh=JIHz1Ii0Zrl18BJy0HYWj6Bh/T+WmbyIKXG99891Bv4=; b=ltqkfsfzeZOObNkaL9aT6CqjcaJsIgZktyUmiPyYQW//VHpjo+BGCo3KzTY7NBq5Uo n80Xg5o9SqNXPRMW/yn1l0i3jxA/pXEL5Y6SKACq/3PbkAH5oGC/cU162yVGCIvHkP+I MgdUkoygcXowRW9xwPaL52pPCOsYlrXfxGLXWYgqLY3sf5HoBZaw3mJQ4G+Ou8Ve+dWX L3z4Wc7cU1U3plFEue65LdFjj+jsftlWxbSQvcTWuUzS9E9cScC9lDYGZlCav0+B6qRs Hgf9F6gxyToZNcIF1WtiFOi/xF3WmytCi8aQ0Aaq2UFv5L1gMp/riyvch6nY3kFjxw6Y mRCA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774510355; x=1775115155; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=eM7S3YYXLh1P1o1wL1v+Pkq0TeVuiQARe4KNYXpkGWQ=; b=EEsSQHUdWGNiN7xe4HXxuy6ebGZvLvV1g6BVF71Nz6PJSQRSO33UI55qg+JxgCP/dn zVPhB3ZL8A/zaG7Z6PeNo3VnMPco/GVQ9AFqjG8hdK5sjOOtmTQD5sDy1qJBIOXXj43u 85NxHG4mAUdfxbv/QaE1jpLh7o21r1Y2H6y1vHT+W3DjS+LCgouiqsnBdAx/Hqcu7/uu 7VBgMp5VNc6hIugAToqGV1gEIe5vbIUC75kgtniwABrNlDtScDT+qHGDyZqzxxrWyCi0 qiqbUa4hOpzmlUMRp18easzpRr+/cF4bDbaSHCZZnosenAQTHKEnaNCHracDbk73C15/ lq6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774510355; x=1775115155; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eM7S3YYXLh1P1o1wL1v+Pkq0TeVuiQARe4KNYXpkGWQ=; b=IKGm88GcFqqLK+c3Oa/1DSDHYn84jkWrba+2pWSSxthIi5itaCQ/18cXuuzBpRijjj ZVySBXCZccpEzSEoAFSZtz4YJCj27QHjOgbYGvlszZsLVHFkBScotS5eIcSj02iaFWJh EmFUyrgtTPbBOjhvwOJi4DVOskutwgrWelRuohL/mpRLnnkqcv//xK7AL3MGaZUfcdcU 57zXSeL5lpKayFakXwsITEtL+h6w3eZNpKn+EUeQAndUarFSnBRalnYR1kDaariUYVEv 5PFGec1aHnBnOOyv8Yib254j8GuHVwcWsOABSQwZFMbjK2f21Qg6QDWK8HcJ5sC3JH5L 1NfQ== X-Gm-Message-State: AOJu0YzkGGMHIl8W5cgSNl8h5PZv1aF14aDwuP+DHxIURx0rWEYN0L/M M20jfBot31CD8J8L6lnAyXN4WJVdJRDlNvZWMZalJadEoz0LqZdLvZNoMqFC4F1UTLsJRgv4MDs qItK1heFqRE/L052g3Nb7dc8pyxOnmC0= X-Gm-Gg: ATEYQzwRTqqbCcd0AYY4MsPsGLCzWkITihFTWh1+55PnQm8S2LCCgHwWIBojZsWfDpN N1/g4ERK7nl32KkvBqqM45lVY0u9I0+Wm9xmmd2Xu4xcZjvcTuNl14C1f7ik4rpZQl+6Lf+wOCL BH9m4yGv8m7WoCCgoxrxKE63uRuuiO3tzmKnHI7LCIocxjYWSP87qtbth68hcoGJYALT5xoxyeK yEtK263/HgPaMWiW5pHDTIWjI3jFCdfjyQir2drh7WtUlirOPjtXGSkWIJ6/Z4ITv8nC6Rvoz1Z aP6SZ05F X-Received: by 2002:a17:90b:4b:b0:359:f43d:4a6e with SMTP id 98e67ed59e1d1-35c0dba5120mr6610284a91.0.1774510354826; Thu, 26 Mar 2026 00:32:34 -0700 (PDT) MIME-Version: 1.0 References: <2DCDBFFC-4B03-4EBC-88A3-06AD29933F17@yandex-team.ru> In-Reply-To: <2DCDBFFC-4B03-4EBC-88A3-06AD29933F17@yandex-team.ru> From: Nikhil Chawla Date: Thu, 26 Mar 2026 13:02:23 +0530 X-Gm-Features: AQROBzAgRgin-Fuzk4vq6FQ0-fryoRzjcVI4nqfCfaM69YRQVDoVfd74krdteKU Message-ID: Subject: Re: [PATCH] Add prepared_orphaned_transaction_timeout GUC To: Andrey Borodin Cc: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000005987cd064de86363" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005987cd064de86363 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E2=80=AFPM Andrey Borodin wrote: > > > > On 23 Mar 2026, at 16:47, Nikhil Chawla > 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. --=20 Regards, Nikhil Chawla Twitter | LinkedIn --0000000000005987cd064de86363 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Andrey,

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

The same analogy is being applied with orphaned prepared tr= ansactions, which may/may not complete ever , but going to hinder autovacuu= m, 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=E2=80=AFPM Andrey Borodin <x4mmm@yandex-team.ru> wrote:


> On 23 Mar 2026, at 16:47, Nikhil Chawla <chawlanikhil24@gmail.com> wrote:=
>
> idle_in_transaction_session_timeout, idle_session_timeout, statement_t= imeout, but no equivalent for prepared transactions

During implementation of the transaction_timeout we briefly considered prep= ared xacts, but decided that it's a footgun.

DBA can easily do the same with a cron job, but in case of prepared transac= tions monitoring is crucial. Prepared xacts are used to coordinate commit i= n many durable systems and orphan prepared xact is evidence of serious malf= unction.

Silent rollback in any scenario I can imagine is a disaster.


Best regards, Andrey Borodin.


--
Regards,
Nikhil = Chawla
Twitter=C2=A0|=C2=A0LinkedIn

--0000000000005987cd064de86363--