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.98.2) (envelope-from ) id 1xTDqM-00000000C7z-3NFX for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Nov 2026 07:43:07 +0000 Received: from localhost ([127.0.0.1]:53150 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xTDqL-00000003T2p-3MEE for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Nov 2026 07:43:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:35184) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xTDqL-00000003T2h-2CjX for pgsql-hackers@lists.postgresql.org; Tue, 17 Nov 2026 07:43:05 +0000 Received: from mail-pj2-x0b.google.com ([2607:f8b0:4864:39::b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xTDqJ-000000006vD-1tAe for pgsql-hackers@lists.postgresql.org; Tue, 17 Nov 2026 07:43:04 +0000 Received: by mail-pj2-x0b.google.com with SMTP id 98e67ed59e1d1-3b3bbd46625so48079a91.1 for ; Mon, 16 Nov 2026 23:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794901383; x=1795506183; darn=lists.postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=SQSLrkBKM3aAtwhy8p4XOgS421c6hVhxvnimwM0zH54=; b=U8qe6BX3u6p+mITHYAcJrPJQQwn71nnKmD64VReiRBj0HpPxd7c0e5xiBGVrBD6Qgk 2p0bdAOsvILE/Th6KIG7ZiE4LvRNGM4/fKqbncFbTjVcJESGhRWIlSW/X6mh64ksXTNC TBm8t6oa73YK86QgUy1wEMu6HF7Y+asQZEVadBay8e1weTRSlcr4+NKdd9NxlwcXM8Qg h49vcwspL8rUrZA84Ovvg89PURZwydiFlFbfUsEAvXI4o8//pdf2CebU2qFTlXNY28Bj GSGZlAhHatI4ihpPO5InLEMPvjkR8R9sFqrTCml9pPcHRESZJGRtVksBfKOx6XNOtrHB QKMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794901383; x=1795506183; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=SQSLrkBKM3aAtwhy8p4XOgS421c6hVhxvnimwM0zH54=; b=ZloinQUlziPna4mK5OF8S4iXbHuXL7VJuVnQwvwfmn6ElejG6errkwlVMEM7QR/R7J ulP2Q1fYmMq5MuLLhH1UdXVfbvbcOHhCBrSheEqvoMq8DJQ5KPmAygaMGdm6cgjYgxAO wVZuq4+2cU8qF3n6741gyMzm5Fc4YcQU3rNsoBaTLFH7o7xWoaw3VevehyKzISPw5Y/r hRwi4ktnMpn3i2gTV9oENTtvFjW0OwJnagzt0Rl0ZaGt/s6klrwf4rOJwbBe+dhf3ody cNtNWzIc2Hqskkzl4QQ6CAwVMlJW8RhnWP35J5ivkl8vSLK4sSDWks7Thslc6GkN+Txj igLA== X-Forwarded-Encrypted: i=1; AL+hErE35xsFDBupkYy4M3h0nHzrFwTDk3RDPOgddxeGQ12KhrP7d8qZ1czqyx53nx484l1/MGMbN+OzGM2u6sCH@lists.postgresql.org X-Gm-Message-State: APuU4Z9PGRER+HE/zcQ7M13Flj0FsPcXqBMSd8+lX4Lwvc0hoCU/rZh6 oJIsFVYR1tiOJxsxStCQGKRvItbxSOF2m2aSWWExN3Fn2fOjkhr60qca X-Gm-Gg: AZFdTZd+pK7IY4FKvdlraDMvChvyTRqv6C8rzjU6qrzZ07eJ4gCrZC/Ji2mE0IVIn6E QrJyROaB30o66ZyOREQwUc+ZMqRSJjpuPkb+D3KgB3DvLJkesmxqd2E4mHqQNh/esNRiGXmk9aL vyossV9Uphkeps/4GR80DpzEorpqRm2zbm/tA4+EDrKSwtxExZ7/0enBs7Zxn89mYY9Wvs2+Fsv Y28kGN1WMp1iUILR2lTJHBC8gEmr4qofkcR/H2xKocItVSMPUzgk6H54VEfZZln8i405k/OylBu IKj5ynN7c4XBi6CZmgw/auJ6odk+0rmemHr5pGRY0yq1CwQYGdP3MFYZsKYp7lIN3gZK663XvoN +qyWMauV3SBOBv5463mi6RIuLs7mE14+SlBv7UXxJbL+m8stGQ0682A/h/SM2YhgpssxkdAh+AB oivkS+l8XO6G7JNJ/VFnU9JMW3GLIkGTBPF8IqLdW0So9kh4vrjEndseYsQu0Mdla9jVLT0DVbF RXk22UMk4Qaw/gkvupsxP5a9NL9Unm4uTNaBWFukX3930hf7WA+U1aPSnbP3h1cbjdQYyGNjeN4 WQKbn3eaTElALyXsuaqkQYLvCRjs0kXX3jHaBjXPmwc2Wz9g6CP+7nTND8l28QjS0PzGrXFE7j4 fzqtd/JwLxofX4ZGt60PtLBrIM3A3KhVC1vZ3I2cdsjRGiEeOPLv6t6Xk1z9eSCETysPlya7eZk Q2w8aNYIXAVi5tsLwksdhxuV5dXEfEaWWy/A== X-Received: by 2002:a17:90b:3d44:b0:3ae:5572:c4d1 with SMTP id 98e67ed59e1d1-3b1b0caba3amr11966252a91.62.1794901382889; Mon, 16 Nov 2026 23:43:02 -0800 (PST) Received: from ?IPV6:2400:79c0:20d:180:982d:8d89:33f7:e984? ([2403:300:600d:d80:a4ea:8d89:33f7:e984]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b3abd063e8sm2761100a91.8.2026.11.16.23.42.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Nov 2026 23:43:02 -0800 (PST) Message-ID: <3730ab93-8a56-4e89-b61d-e4ebb9f58877@gmail.com> Date: Tue, 17 Nov 2026 15:42:58 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Document prepared transaction lock waits with two_phase subscriptions To: Masahiko Sawada , Amit Kapila Cc: Bertrand Drouvot , "pgsql-hackers@lists.postgresql.org" , Nisha Moond , shveta malik , Dilip Kumar References: <72c9b956-96c3-40a5-99bb-d9b7338c0bab@gmail.com> <53ca9f95-aacb-4e9e-9021-e4abe01e000e@gmail.com> From: Zhijie Hou In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Nov17, 2026 at 02:49 PM Masahiko Sawada wrote: > > +1 for documenting this behavior. I think we can backpatch it. > > Regarding the proposed description, I think it would be better to > suggest cancelling the waiting session as the primary way to resolve > the situation, and to mention manually rolling back the prepared > transaction as an alternative. Cancelling the waiting session always > unblocks the apply worker, whereas the latter requires several steps. > On the other hand, manually rolling back the prepared transaction > requires several steps: disabling the subscription, waiting for the > worker to exit, setting two_phase to false, and enabling the > subscription again etc.. Also, I think the description should say to > disable the subscription first, then roll back the prepared > transaction, set two_phase to false, and enable the subscription again > as Kuroda-san suggested. It might also be worth noting that the > transaction is applied again after the waiting command completes. Thanks for the comments. I think V3[1] covers the points you mentioned. what do you think? [1] https://www.postgresql.org/message-id/51a90195-3a5c-429b-a978-e639df8bc225%40gmail.com -- Best Regards, Zhijie Hou