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 1w7A6q-00518h-1d for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 10:44:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7A6o-002bwi-33 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 10:44:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w7A6o-002bwa-2A for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 10:44:39 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7A6m-00000001yhx-1Ldv for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 10:44:38 +0000 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-c73e9e4cdf7so1826561a12.2 for ; Mon, 30 Mar 2026 03:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774867475; cv=none; d=google.com; s=arc-20240605; b=Q6BB2ANMOUy5IG26FyC0BiIlftuYcKQsJHb0Z6k/Yhs9s7z3zGjdCivmxHzItyBt+n OBL1ImCq9g2SiQDTQjOhEmM+KfgSylKX6JWVWw8ugeTFoq+JWHlP6H7XjtMRsF4+CUO3 h6Dsa81PhuoxHzhtTtMd0cfL1Tin1yIhJ+Db731wgTqQCl8qoaPxPpfQzjxzgF2Uw1oN f75x5jiAzyDtkJ7iPkAmdNvjLMKDRNTFRyHnk5HNwnoBb6O4dJGv4B0pctmQcUs20YkD UeiOp0RroS2UVmMYYAHAZfcbIr5a1jd8dlpg9tZsEakPXasZRgbprU1rb7BuTzc1s38z 4I+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=8lJhlDdrsoqKrlOG4NTZ9n+E8bSnDQyoOVOMSUB8Wt4=; fh=NaOSJoP61PQnScKws0INa2E7LngQUr5txVzrhon7czY=; b=ZmxDNjw14nqrvs+NnUpXB1Zd/Yq6tNlimYiQ76AyRRDsPqeRwibYMy3DcGrYW8YpGW 3r5kScAmS2Knsk+qsuuH7uo2TNKFMsuoyVOgVxZ459Luf6f8DLuCqzigO7igjArIpDHe Yb6z+fEb7+66PWpGukeGQizBsNpbioRSIXVz51Rbfkq7yiUaqnF9RnW8ocTDrcH17La/ RL8V8HmCaWrnaKV2PqIQIUdNmIoeWnaGV27VAtwOaLLJ4AjJNOVKQDY6JDmzwvMr1Cic QbYEwv0BTSMvBPcb8ct1+/XjPnsJTC12TyQJV6EdAofGTO3pPqIL50JjGtFgt4wnKhge pPew==; 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=1774867475; x=1775472275; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=8lJhlDdrsoqKrlOG4NTZ9n+E8bSnDQyoOVOMSUB8Wt4=; b=NKULXDFxQEDoZnpWYA/JO+/Sav6wuWXgCBQICFRmipwvWU52ITx/pOahJ/J0o4Egb6 kWtQhku6HCDj20WYFF9D4p9qs+NPgzWH9uB94jNUJiff39F+MnwRh2fSfG3fjyC4n6CP OriNTn6B7/kBn4svKd/XuPdGKIOW21SBxXRlogXPE4yrY2nZ8/Yx0OtuHD4VpL985F/b AVZVN2lU5MgcUPJjm59C4lDHvPBMuNlXU62GyHJoBuqvDVRZENm9tQF3t8JfpuQpMqpv hHqoW6zwY8I9hZFfENCUH399POg9rLnfWuDoobmOe/lB1UNPmJOoM/cx3yxsgZ0F/EOp f7Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774867475; x=1775472275; h=content-transfer-encoding:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8lJhlDdrsoqKrlOG4NTZ9n+E8bSnDQyoOVOMSUB8Wt4=; b=mMphitnCQdgdXJ7foKBIVUZ/8RIU6H4lIOImQK41uGTqpuXAfQUQ95hv4yxU15/2Ae 1j1aQcLnzFAkhq1sdNyzHpNJYXxgoE2CNYcg1Q0ObngXnAVeZWYMUdLMIlliREr0Ahcw TC+9hqXsi6CqwF8UllukslswnKhAB9nqDg0SQyPUMCFnJCP1xa08gL567jvKOIASaqW5 DQ3CXy5Gw9O8aSF6987xSOJ8WO97lX5zr3CQsN+1VXLHZmKz+Z7HS7/JgnDePGhxrP9h 0+CGfvztmYAT5vZxyfZYLAiMdRK9E7xcliLo2mEkmNclil3itgSeoMdwMChSVWyDkGkF zmFA== X-Forwarded-Encrypted: i=1; AJvYcCW8R5ghzADBoeE1Cwzxs6pPX2DSbIMy+wSs9NxAcO/ykx7iZahsO8e/nXSVSfl23qDuCJvClKHO4dOrMAO7@lists.postgresql.org X-Gm-Message-State: AOJu0YzFxF/dk6CZriS3w1ip6nnVb+WHWxr0/Bfrb0Chk6e7IQr8ZONK 1AMiUhcoxpUwVWhI7XCbt0VnVPKM5fav4mYspyIyq70RT5zvzQMFYC2QAKNThCz0NmE4ZPJxlms P/H0TGTdWoPND+6r6EpwThufYiXqySLQ= X-Gm-Gg: ATEYQzxxePpuoCXgDEoA70oKJS5u7pOzE4iPQBIpHapnyBpI6WBOEaxycZc6PKh0bLz g6kjNRgxpkzDSsVrmFqZWQ4E9XzxShgsPK4h2ZvsFvxd0FB1dxq3QZAtOLC0K27co1aBAyqn1r2 aJKD50mZwoKebJ03TFQYprrumbmEr2tGZrYQUt4eJpF4sj35iHlg/lC7kLrZ1UEZCFqIZ3tHe3B s2V+7NOxETRoh5hio0IW6P2FbCZGjL/xk+ol8CiZvK2ry9Vf7LKcTVlGmDDfuf6reTOCaPwD6k3 3IAOuW1KRbvLgR5m X-Received: by 2002:a05:6a00:2887:b0:82c:6648:643b with SMTP id d2e1a72fcca58-82c96038b0amr10431870b3a.40.1774867474926; Mon, 30 Mar 2026 03:44:34 -0700 (PDT) MIME-Version: 1.0 References: <2DCDBFFC-4B03-4EBC-88A3-06AD29933F17@yandex-team.ru> In-Reply-To: Reply-To: zaartur@gmail.com From: Artur Zakirov Date: Mon, 30 Mar 2026 12:44:23 +0200 X-Gm-Features: AQROBzB3KwM37uGIGdA3lLir83LVMN1NgggQ4ltX22VhqTT-HqcaxQcD8EySeUQ Message-ID: Subject: Re: [PATCH] Add prepared_orphaned_transaction_timeout GUC To: Nikhil Chawla Cc: Andrey Borodin , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk >> Silent rollback in any scenario I can imagine is a disaster. > ... > The same analogy is being applied with orphaned prepared transactions, wh= ich may/may not complete ever , but going to hinder autovacuum, increasing = bloat. When user sets the value, user will be aware that the prepared trans= actions can disappear automatically. I agree with Andrey. And I think we cannot use the same analogy of "long running transactions" to prepared transactions. Prepared transactions are part of 2PC protocol. And this GUC would break 2PC protocol, which is after all distributed participants successfully executed PREPARE you can successfully execute COMMIT, if a database is healthy. Another point is that rollback is not always a proper action on a dangling prepared transaction. If you move data from Instance1 to Instance2 and a prepared transaction on Instance1 was committed, but you have a dangling prepared transaction on Instance2 for some reason, then you want to COMMIT it on Instance2, not to roll back. And vice versa, if the prepared transaction on Instance1 was rolled back, then you want to roll it back on Instance2. What to do with the prepared transaction should be decided by a transaction manager.