pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zhijie Hou <houzhijie22@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: Nisha Moond <nisha.moond412@gmail.com>
Cc: shveta malik <shveta.malik@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Subject: Re: Document prepared transaction lock waits with two_phase subscriptions
Date: Tue, 17 Nov 2026 15:42:58 +0800
Message-ID: <3730ab93-8a56-4e89-b61d-e4ebb9f58877@gmail.com> (raw)
In-Reply-To: <CAD21AoAOuwKeOO4H+YHYS67sPpseYRUXioXdjDNhRESZwiJ=iQ@mail.gmail.com>
References: <72c9b956-96c3-40a5-99bb-d9b7338c0bab@gmail.com>
	<avrOjINXdJs1XiwW@bdtpg>
	<53ca9f95-aacb-4e9e-9021-e4abe01e000e@gmail.com>
	<avsI2UmGU6U8TQlF@bdtpg>
	<CAA4eK1+kK_aV4=ajvz1J2vdUpr9UR_ZZ5gM-TJON+vGFjrEbvA@mail.gmail.com>
	<CAD21AoAOuwKeOO4H+YHYS67sPpseYRUXioXdjDNhRESZwiJ=iQ@mail.gmail.com>

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






view thread (15+ messages)  latest in thread

Message-ID: <3730ab93-8a56-4e89-b61d-e4ebb9f58877@gmail.com>
Permalink:  ../3730ab93-8a56-4e89-b61d-e4ebb9f58877@gmail.com/
Also on:    postgresql.org/message-id/3730ab93-8a56-4e89-b61d-e4ebb9f58877@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: houzhijie22@gmail.com, sawada.mshk@gmail.com, amit.kapila16@gmail.com, bertranddrouvot.pg@gmail.com, nisha.moond412@gmail.com, shveta.malik@gmail.com, dilipbalaut@gmail.com
  Subject: Re: Document prepared transaction lock waits with two_phase subscriptions
  In-Reply-To: <3730ab93-8a56-4e89-b61d-e4ebb9f58877@gmail.com>
  References: <72c9b956-96c3-40a5-99bb-d9b7338c0bab@gmail.com> <avrOjINXdJs1XiwW@bdtpg> <53ca9f95-aacb-4e9e-9021-e4abe01e000e@gmail.com> <avsI2UmGU6U8TQlF@bdtpg> <CAA4eK1+kK_aV4=ajvz1J2vdUpr9UR_ZZ5gM-TJON+vGFjrEbvA@mail.gmail.com> <CAD21AoAOuwKeOO4H+YHYS67sPpseYRUXioXdjDNhRESZwiJ=iQ@mail.gmail.com> <3730ab93-8a56-4e89-b61d-e4ebb9f58877@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox