pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Document prepared transaction lock waits with two_phase subscriptions
15+ messages / 7 participants
[nested] [flat]

Commits from this thread:
  2026-11-18 75a4305437 d4f29ef800 2490a75646 94fc1c08f5 3ec081c4cc f03a0f8796  Doc: Explain prepared transaction lock waits with two_phase subscriptions.
* Document prepared transaction lock waits with two_phase subscriptions
@ 2026-11-13 03:58 Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Zhijie Hou @ 2026-11-13 03:58 UTC (permalink / raw)
  To: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; +Cc: amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>

Hi,

While reviewing the prepared-transaction locking hazard involving the 
conflict log table [1], we noticed that the issue is not specific to the 
conflict log table and also affects regular user tables.

When two_phase is enabled, a prepared transaction on the publisher is 
also prepared on the subscriber, and like any prepared transaction, it 
continues to hold its locks until COMMIT PREPARED or ROLLBACK PREPARED. 
On the subscriber, if a replicated prepared transaction holds a lock on 
a user table and a local session then tries to acquire a conflicting 
lock on the same table (e.g., via TRUNCATE, VACUUM FULL, or ALTER 
TABLE), the local session will block.

In this state, if there are further replicated changes on the same 
table, the apply worker will also be blocked when acquiring the table 
lock to apply those changes. Because the apply worker cannot advance to 
subsequent transactions, even if COMMIT PREPARED or ROLLBACK PREPARED is 
issued on the publisher, the apply worker will not be able to reach and 
apply it. As a result, replication stalls because the sessions wait for 
each other, and the deadlock detector does not detect this wait cycle 
since the prepared transaction is not waiting on any lock. This is 
similar to the existing caution in the prepared transaction documentation:

"""
   It is unwise to leave transactions in the prepared state for a long 
time ... Keep in mind also that the transaction continues to hold 
whatever locks it held. The intended usage of the feature is that a 
prepared transaction will normally be committed or rolled back as soon 
as an external transaction manager has verified that other databases are 
also prepared to commit.
"""

To recover from this state, the user can either cancel the waiting local 
session on the subscriber so the apply worker can proceed, or manually 
roll back the prepared transaction on the subscriber, disable two_phase 
until that transaction is replicated again after being committed on the 
publisher, and then re-enable two_phase if required. Considering the 
existing caution about prepared transactions and the available 
workarounds, we suggest documenting this locking hazard and how to 
resolve it for logical replication as well. Please see the attached 
patch for the documentation changes.

Apart from documenting this, Amit, Nisha, and I also discussed off-list 
whether the apply worker could detect and resolve this wait cycle 
automatically. One option we considered is to have the apply worker walk 
its lock blocking chain once a lock wait exceeds deadlock_timeout. 
Starting from the lock it is waiting for, the worker would trace 
conflicting lock holders and conflicting waiters ahead of it in the wait 
queue (similar to how pg_blocking_pids() finds blockers) to see whether 
the chain leads back to a prepared transaction of the same subscription, 
and if so, cancel the session waiting on that prepared transaction (or 
raise an error if the worker is directly blocked by its own prepared 
transaction). However, this effectively introduces a separate wait-graph 
traversal alongside the existing deadlock detector, which seems overly 
complex for this scenario.

We also thought about a much simpler check where, on timeout, the apply 
worker only inspects the lock it is currently waiting on and treats it 
as a wait cycle if a prepared transaction of the same subscription also 
holds a lock on that same table. Unfortunately, that does not cover 
multi-table cases. For example, suppose a prepared transaction holds a 
lock on table t1, a local session acquires AccessExclusiveLock on table 
t2 and then blocks trying to TRUNCATE t1, and the apply worker next 
tries to apply a change to t2. Because the apply worker is waiting on t2 
while the prepared transaction holds the lock on t1, inspecting only 
t2's lock would miss the cycle.

Given these trade-offs, we prefer to document this locking hazard and 
the workarounds for now.

[1] 
https://www.postgresql.org/message-id/CAJpy0uAWb7hs0271M_NxhOpetAfFcQidrUce5xSOL8jU3Hx1iQ%40mail.gma...

-- 
Best Regards,
Zhijie Hou

Attachments:

v1-0001-Document-prepared-transaction-lock-waits-with-two.patch (text/plain, 3.9K) download From a52d72efa325edceb6928e5e84a404d51a4e32eb Mon Sep 17 00:00:00 2001 From: Zhijie Hou <houzhijie22@gmail.com> Date: Fri, 13 Nov 2026 09:58:46 +0800 Subject: [PATCH v1] Document prepared transaction lock waits with two_phase subscriptions. When two_phase is enabled for a subscription, a transaction prepared by the apply worker continues to hold its locks until COMMIT PREPARED or ROLLBACK PREPARED is applied. If another session requests a conflicting lock on a table modified by that prepared transaction, it waits behind the prepared transaction, and subsequent lock requests by the apply worker on the same table queue behind that session. Because the prepared transaction is not waiting on any lock, this wait cycle is not detected as a deadlock and replication stalls. Document this caveat and how to recover from it under CREATE SUBSCRIPTION and PREPARE TRANSACTION. --- doc/src/sgml/ref/create_subscription.sgml | 21 +++++++++++++++++++++ doc/src/sgml/ref/prepare_transaction.sgml | 5 ++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index 6248c228a64..b2e6b8d9360 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -424,6 +424,27 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl are then processed immediately by the subscriber. </para> + <para> + A prepared transaction applied on the subscriber keeps its locks + until the apply worker processes the corresponding + <command>COMMIT PREPARED</command> or <command>ROLLBACK + PREPARED</command>. If another session requests a conflicting lock + on a table modified by such a transaction (for example, with + <command>LOCK</command>, <command>TRUNCATE</command>, or + <command>ALTER TABLE</command>), it has to wait, and later lock + requests on that table, including the apply worker's own next + change to it, queue behind it. The apply worker then cannot reach + the <command>COMMIT PREPARED</command> or <command>ROLLBACK + PREPARED</command> that would release the lock, and the sessions + wait for each other. This is not detected as a deadlock, so + replication stalls. To resolve this, either cancel the waiting + session, or manually roll back the prepared transaction on the + subscriber, disable <literal>two_phase</literal> (see + <link linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION ... SET</literal></link>) + until that transaction is committed on the publisher and replicated + again, and then re-enable <literal>two_phase</literal> if required. + </para> + <para> The implementation of two-phase commit requires that replication has successfully finished the initial table synchronization diff --git a/doc/src/sgml/ref/prepare_transaction.sgml b/doc/src/sgml/ref/prepare_transaction.sgml index f4f6118ac31..22f4feca64d 100644 --- a/doc/src/sgml/ref/prepare_transaction.sgml +++ b/doc/src/sgml/ref/prepare_transaction.sgml @@ -132,7 +132,10 @@ PREPARE TRANSACTION <replaceable class="parameter">transaction_id</replaceable> continues to hold whatever locks it held. The intended usage of the feature is that a prepared transaction will normally be committed or rolled back as soon as an external transaction manager has verified that - other databases are also prepared to commit. + other databases are also prepared to commit. A transaction prepared by a + logical replication apply worker can be completed only by that worker, see + <xref linkend="sql-createsubscription-params-with-two-phase"/> for a + lock wait this can cause. </para> <para> -- 2.54.0 (Apple Git-157)
^ permalink raw reply [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
@ 2026-11-16 09:36 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Bertrand Drouvot @ 2026-11-16 09:36 UTC (permalink / raw)
  To: Zhijie Hou <houzhijie22@gmail.com>; +Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

Hi,

On Fri, Nov 13, 2026 at 11:58:10AM +0800, Zhijie Hou wrote:
> 
> To recover from this state, the user can either cancel the waiting local
> session on the subscriber so the apply worker can proceed, or manually roll
> back the prepared transaction on the subscriber, disable two_phase until
> that transaction is replicated again after being committed on the publisher,
> and then re-enable two_phase if required. Considering the existing caution
> about prepared transactions and the available workarounds, we suggest
> documenting this locking hazard and how to resolve it for logical
> replication as well.

Yeah, +1 for documenting it. 

> Please see the attached patch for the documentation changes.

=== 1

I wonder if it would also be worth mentioning a nonzero lock_timeout as a possible
mitigation too?

=== 2

+    logical replication apply worker can be completed only by that worker, see

s/can be completed only by that worker/is normally completed by the subscription's apply worker/?

=== 3

+          <command>ALTER TABLE</command>), it has to wait, and later lock
+          requests on that table

s/later lock requests/later conflicting lock requests/?

=== 4

+          The apply worker then cannot reach
+          the <command>COMMIT PREPARED</command> or <command>ROLLBACK
+          PREPARED</command> that would release the lock, and the sessions
+          wait for each other.  This is not detected as a deadlock, so
+          replication stalls.

what about?

or <command>ROLLBACK PREPARED</command>. This situation is not detected as a
deadlock, so replication can remain stalled indefinitely.

> Apart from documenting this, Amit, Nisha, and I also discussed off-list
> whether the apply worker could detect and resolve this wait cycle
> automatically. One option we considered is to have the apply worker walk its
> lock blocking chain once a lock wait exceeds deadlock_timeout. Starting from
> the lock it is waiting for, the worker would trace conflicting lock holders
> and conflicting waiters ahead of it in the wait queue (similar to how
> pg_blocking_pids() finds blockers) to see whether the chain leads back to a
> prepared transaction of the same subscription, and if so, cancel the session
> waiting on that prepared transaction (or raise an error if the worker is
> directly blocked by its own prepared transaction). However, this effectively
> introduces a separate wait-graph traversal alongside the existing deadlock
> detector, which seems overly complex for this scenario.

Yeah, I agree. Teaching the lock manager about this logical dependency seems too
complex.

> We also thought about a much simpler check where, on timeout, the apply
> worker only inspects the lock it is currently waiting on and treats it as a
> wait cycle if a prepared transaction of the same subscription also holds a
> lock on that same table. Unfortunately, that does not cover multi-table
> cases.

Agreed. FWIW, lock_timeout on the local session handles this multi-table case too.

> Given these trade-offs, we prefer to document this locking hazard and the
> workarounds for now.

Another options I could see (because the doc changes explain the workarounds)
would be to help diagnose:

1/ improve log_lock_waits to identify a prepared transaction holding a lock by
its XID, instead of reporting it as process 0.

2/ improve the existing pg_locks example query so that it identifies locks
held by both newly prepared and recovered prepared transactions.

Thoughts?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com






^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
@ 2026-11-16 12:20   ` Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 13:44     ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-17 05:25     ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
  0 siblings, 2 replies; 15+ messages in thread

From: Zhijie Hou @ 2026-11-16 12:20 UTC (permalink / raw)
  To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; +Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

Hi,

On Mon, Nov16, 2026 at 05:36 PM Bertrand Drouvot wrote:
>
> On Fri, Nov 13, 2026 at 11:58:10AM +0800, Zhijie Hou wrote:
> >
> > To recover from this state, the user can either cancel the waiting
> > local session on the subscriber so the apply worker can proceed, or
> > manually roll back the prepared transaction on the subscriber,
> > disable two_phase until that transaction is replicated again after
> > being committed on the publisher, and then re-enable two_phase if
> > required. Considering the existing caution about prepared
> > transactions and the available workarounds, we suggest documenting
> > this locking hazard and how to resolve it for logical replication as
> > well.
>
> Yeah, +1 for documenting it.
>
> > Please see the attached patch for the documentation changes.

Thanks for reviewing.

>
> === 1
>
> I wonder if it would also be worth mentioning a nonzero lock_timeout
> as a possible mitigation too?

Before adding this, I'd like to confirm what would be a good way to 
suggest users configure lock_timeout here. Setting lock_timeout globally 
(or at the database level) would also apply to the logical replication 
apply worker itself (potentially causing it to error out on normal lock 
waits). On the other hand, setting it per session/transaction before 
running commands that take conflicting locks (such as TRUNCATE, ALTER 
TABLE, LOCK, etc.) avoids that, though there are many commands that can 
take conflicting locks so users would need to remember to set it 
whenever running them (or set it per role for administrative sessions). 
Do you have per-session usage in mind, or another way of using lock_timeout?

>
> === 2
>
> +    logical replication apply worker can be completed only by that worker, see
>
> s/can be completed only by that worker/is normally completed by the subscription's apply worker/?
>
> === 3
>
> +          <command>ALTER TABLE</command>), it has to wait, and later lock
> +          requests on that table
>
> s/later lock requests/later conflicting lock requests/?
>
> === 4
>
> +          The apply worker then cannot reach
> +          the <command>COMMIT PREPARED</command> or <command>ROLLBACK
> +          PREPARED</command> that would release the lock, and the sessions
> +          wait for each other.  This is not detected as a deadlock, so
> +          replication stalls.
>
> what about?
>
> or <command>ROLLBACK PREPARED</command>. This situation is not
> detected as a deadlock, so replication can remain stalled
> indefinitely.

Thanks 2, 3 and 4 look good to me and addressed in V2.


> > Given these trade-offs, we prefer to document this locking hazard
> > and the workarounds for now.
>
> Another options I could see (because the doc changes explain the
> workarounds) would be to help diagnose:
>
> 1/ improve log_lock_waits to identify a prepared transaction holding a
> lock by its XID, instead of reporting it as process 0.
>
> 2/ improve the existing pg_locks example query so that it identifies
> locks held by both newly prepared and recovered prepared transactions.
>
> Thoughts?

Both sound like useful diagnostic improvements for prepared transactions 
in general (even outside logical replication), so +1 for discussing them 
in a separate thread.

-- 
Best Regards,
Zhijie Hou

Attachments:

v2-0001-Document-prepared-transaction-lock-waits-with-two.patch (text/plain, 3.9K) download From fbb58d42e03bebc13286cc5100db4280dbdf50f0 Mon Sep 17 00:00:00 2001 From: Zhijie Hou <houzhijie22@gmail.com> Date: Mon, 16 Nov 2026 19:46:09 +0800 Subject: [PATCH v2] Document prepared transaction lock waits with two_phase subscriptions. When two_phase is enabled for a subscription, a transaction prepared by the apply worker continues to hold its locks until COMMIT PREPARED or ROLLBACK PREPARED is applied. If another session requests a conflicting lock on a table modified by that prepared transaction, it waits behind the prepared transaction, and subsequent conflicting lock requests by the apply worker on the same table queue behind that session. Because the prepared transaction is not waiting on any lock, this situation is not detected as a deadlock and replication can remain stalled indefinitely. Document this caveat and how to recover from it under CREATE SUBSCRIPTION and PREPARE TRANSACTION. --- doc/src/sgml/ref/create_subscription.sgml | 21 +++++++++++++++++++++ doc/src/sgml/ref/prepare_transaction.sgml | 6 +++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index 6248c228a64..c4c6f47fe2a 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -424,6 +424,27 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl are then processed immediately by the subscriber. </para> + <para> + A prepared transaction applied on the subscriber keeps its locks + until the apply worker processes the corresponding + <command>COMMIT PREPARED</command> or <command>ROLLBACK + PREPARED</command>. If another session requests a conflicting lock + on a table modified by such a transaction (for example, with + <command>LOCK</command>, <command>TRUNCATE</command>, or + <command>ALTER TABLE</command>), it has to wait, and later + conflicting lock requests on that table, including the apply + worker's own next change to it, queue behind it. The apply worker + then cannot reach the <command>COMMIT PREPARED</command> or + <command>ROLLBACK PREPARED</command>. This situation is not + detected as a deadlock, so replication can remain stalled + indefinitely. To resolve this, either cancel the waiting session, + or manually roll back the prepared transaction on the subscriber, + disable <literal>two_phase</literal> (see + <link linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION ... SET</literal></link>) + until that transaction is committed on the publisher and replicated + again, and then re-enable <literal>two_phase</literal> if required. + </para> + <para> The implementation of two-phase commit requires that replication has successfully finished the initial table synchronization diff --git a/doc/src/sgml/ref/prepare_transaction.sgml b/doc/src/sgml/ref/prepare_transaction.sgml index f4f6118ac31..a9778866496 100644 --- a/doc/src/sgml/ref/prepare_transaction.sgml +++ b/doc/src/sgml/ref/prepare_transaction.sgml @@ -132,7 +132,11 @@ PREPARE TRANSACTION <replaceable class="parameter">transaction_id</replaceable> continues to hold whatever locks it held. The intended usage of the feature is that a prepared transaction will normally be committed or rolled back as soon as an external transaction manager has verified that - other databases are also prepared to commit. + other databases are also prepared to commit. A transaction prepared by a + logical replication apply worker is normally completed by the + subscription's apply worker; see + <xref linkend="sql-createsubscription-params-with-two-phase"/> for a + lock wait this can cause. </para> <para> -- 2.54.0 (Apple Git-157)
^ permalink raw reply [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
@ 2026-11-16 13:44     ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-17 02:53       ` Re: Document prepared transaction lock waits with two_phase subscriptions Amit Kapila <amit.kapila16@gmail.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Bertrand Drouvot @ 2026-11-16 13:44 UTC (permalink / raw)
  To: Zhijie Hou <houzhijie22@gmail.com>; +Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

Hi,

On Mon, Nov 16, 2026 at 08:20:45PM +0800, Zhijie Hou wrote:
> On Mon, Nov16, 2026 at 05:36 PM Bertrand Drouvot wrote:
> > 
> > === 1
> > 
> > I wonder if it would also be worth mentioning a nonzero lock_timeout
> > as a possible mitigation too?
> 
> Before adding this, I'd like to confirm what would be a good way to suggest
> users configure lock_timeout here. Setting lock_timeout globally (or at the
> database level) would also apply to the logical replication apply worker
> itself (potentially causing it to error out on normal lock waits). On the
> other hand, setting it per session/transaction before running commands that
> take conflicting locks (such as TRUNCATE, ALTER TABLE, LOCK, etc.) avoids
> that, though there are many commands that can take conflicting locks so
> users would need to remember to set it whenever running them (or set it per
> role for administrative sessions). Do you have per-session usage in mind, or
> another way of using lock_timeout?

I had per-session/transaction usage in mind, before executing commands that might
request conflicting table locks. A per role setting also makes sense when a
dedicated role is used for administrative commands. I agree that we should not
recommend setting it globally or at the database level, as that would also affect
the apply workers.

What about juse one sentence, something like?

"
Using a nonzero lock_timeout in sessions or transactions that might request such
conflicting locks can prevent them from waiting indefinitely.
"

> Thanks 2, 3 and 4 look good to me and addressed in V2.

Thanks!

> > Another options I could see (because the doc changes explain the
> > workarounds) would be to help diagnose:
> > 
> > 1/ improve log_lock_waits to identify a prepared transaction holding a
> > lock by its XID, instead of reporting it as process 0.
> > 
> > 2/ improve the existing pg_locks example query so that it identifies
> > locks held by both newly prepared and recovered prepared transactions.
> > 
> > Thoughts?
> 
> Both sound like useful diagnostic improvements for prepared transactions in
> general (even outside logical replication), so +1 for discussing them in a
> separate thread.

Thanks for confirming, I'll open a dedicated thread.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com






^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 13:44     ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
@ 2026-11-17 02:53       ` Amit Kapila <amit.kapila16@gmail.com>
  2026-11-17 06:49         ` Re: Document prepared transaction lock waits with two_phase subscriptions Masahiko Sawada <sawada.mshk@gmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Amit Kapila @ 2026-11-17 02:53 UTC (permalink / raw)
  To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; +Cc: Zhijie Hou <houzhijie22@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; Nisha Moond <nisha.moond412@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

On Mon, Nov 16, 2026 at 7:14 PM Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:
>
> On Mon, Nov 16, 2026 at 08:20:45PM +0800, Zhijie Hou wrote:
> > On Mon, Nov16, 2026 at 05:36 PM Bertrand Drouvot wrote:
> > >
> > > === 1
> > >
> > > I wonder if it would also be worth mentioning a nonzero lock_timeout
> > > as a possible mitigation too?
> >
> > Before adding this, I'd like to confirm what would be a good way to suggest
> > users configure lock_timeout here. Setting lock_timeout globally (or at the
> > database level) would also apply to the logical replication apply worker
> > itself (potentially causing it to error out on normal lock waits). On the
> > other hand, setting it per session/transaction before running commands that
> > take conflicting locks (such as TRUNCATE, ALTER TABLE, LOCK, etc.) avoids
> > that, though there are many commands that can take conflicting locks so
> > users would need to remember to set it whenever running them (or set it per
> > role for administrative sessions). Do you have per-session usage in mind, or
> > another way of using lock_timeout?
>
> I had per-session/transaction usage in mind, before executing commands that might
> request conflicting table locks. A per role setting also makes sense when a
> dedicated role is used for administrative commands. I agree that we should not
> recommend setting it globally or at the database level, as that would also affect
> the apply workers.
>
> What about juse one sentence, something like?
>
> "
> Using a nonzero lock_timeout in sessions or transactions that might request such
> conflicting locks can prevent them from waiting indefinitely.
> "

I think configuring such a timeout could be tricky for users
especially when the commands are from scripts. We don't
recommend/document such a setting for blocking due to prepared
transactions, for example, I find the following in the docs: "In cases
involving a conflicting prepared transaction, it may not be possible
to make progress until the prepared transaction commits or rolls
back." for serialization failure handling. So, on similar lines we
should try to avoid lock_timeout recommendation here but if you or
others still feel it is helpful then we can consider.

Overall, I agree with you and Hou-san that documenting the lock waits
due to prepared transactions with two_phase enabled subscriptions is a
better approach as we do at other places especially for back-branches.
Even if we decide to do some special lock-detection mechanism for
prepared transactions (by apply worker) as Hou-San mentioned in his
first email, it should be for HEAD but considering the documented
behavior of prepared transactions and no user report, I feel we don't
need to go there.

-- 
With Regards,
Amit Kapila.






^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 13:44     ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-17 02:53       ` Re: Document prepared transaction lock waits with two_phase subscriptions Amit Kapila <amit.kapila16@gmail.com>
@ 2026-11-17 06:49         ` Masahiko Sawada <sawada.mshk@gmail.com>
  2026-11-17 07:42           ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Masahiko Sawada @ 2026-11-17 06:49 UTC (permalink / raw)
  To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; Zhijie Hou <houzhijie22@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; Nisha Moond <nisha.moond412@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

On Mon, Nov 16, 2026 at 6:54 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Mon, Nov 16, 2026 at 7:14 PM Bertrand Drouvot
> <bertranddrouvot.pg@gmail.com> wrote:
> >
> > On Mon, Nov 16, 2026 at 08:20:45PM +0800, Zhijie Hou wrote:
> > > On Mon, Nov16, 2026 at 05:36 PM Bertrand Drouvot wrote:
> > > >
> > > > === 1
> > > >
> > > > I wonder if it would also be worth mentioning a nonzero lock_timeout
> > > > as a possible mitigation too?
> > >
> > > Before adding this, I'd like to confirm what would be a good way to suggest
> > > users configure lock_timeout here. Setting lock_timeout globally (or at the
> > > database level) would also apply to the logical replication apply worker
> > > itself (potentially causing it to error out on normal lock waits). On the
> > > other hand, setting it per session/transaction before running commands that
> > > take conflicting locks (such as TRUNCATE, ALTER TABLE, LOCK, etc.) avoids
> > > that, though there are many commands that can take conflicting locks so
> > > users would need to remember to set it whenever running them (or set it per
> > > role for administrative sessions). Do you have per-session usage in mind, or
> > > another way of using lock_timeout?
> >
> > I had per-session/transaction usage in mind, before executing commands that might
> > request conflicting table locks. A per role setting also makes sense when a
> > dedicated role is used for administrative commands. I agree that we should not
> > recommend setting it globally or at the database level, as that would also affect
> > the apply workers.
> >
> > What about juse one sentence, something like?
> >
> > "
> > Using a nonzero lock_timeout in sessions or transactions that might request such
> > conflicting locks can prevent them from waiting indefinitely.
> > "
>
> I think configuring such a timeout could be tricky for users
> especially when the commands are from scripts. We don't
> recommend/document such a setting for blocking due to prepared
> transactions, for example, I find the following in the docs: "In cases
> involving a conflicting prepared transaction, it may not be possible
> to make progress until the prepared transaction commits or rolls
> back." for serialization failure handling. So, on similar lines we
> should try to avoid lock_timeout recommendation here but if you or
> others still feel it is helpful then we can consider.
>
> Overall, I agree with you and Hou-san that documenting the lock waits
> due to prepared transactions with two_phase enabled subscriptions is a
> better approach as we do at other places especially for back-branches.
> Even if we decide to do some special lock-detection mechanism for
> prepared transactions (by apply worker) as Hou-San mentioned in his
> first email, it should be for HEAD but considering the documented
> behavior of prepared transactions and no user report, I feel we don't
> need to go there.

+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.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 13:44     ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-17 02:53       ` Re: Document prepared transaction lock waits with two_phase subscriptions Amit Kapila <amit.kapila16@gmail.com>
  2026-11-17 06:49         ` Re: Document prepared transaction lock waits with two_phase subscriptions Masahiko Sawada <sawada.mshk@gmail.com>
@ 2026-11-17 07:42           ` Zhijie Hou <houzhijie22@gmail.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Zhijie Hou @ 2026-11-17 07:42 UTC (permalink / raw)
  To: Masahiko Sawada <sawada.mshk@gmail.com>; Amit Kapila <amit.kapila16@gmail.com>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; Nisha Moond <nisha.moond412@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@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






^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* RE: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
@ 2026-11-17 05:25     ` Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
  2026-11-17 06:26       ` Re: Document prepared transaction lock waits with two_phase subscriptions shveta malik <shveta.malik@gmail.com>
  2026-11-17 06:58       ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  1 sibling, 2 replies; 15+ messages in thread

From: Hayato Kuroda (Fujitsu) @ 2026-11-17 05:25 UTC (permalink / raw)
  To: Zhijie Hou <houzhijie22@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; +Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

Hi,

Thanks for posting the patch. I feel the logging should be improved, but
it might be out-of-scope. Here I focused on the doc patch.

```
+          or manually roll back the prepared transaction on the subscriber,
+          disable <literal>two_phase</literal> (see
+          <link linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION ... SET</literal></link>)
+          until that transaction is committed on the publisher and replicated
+          again, and then re-enable <literal>two_phase</literal> if required.
```

Isn't it better to disable the subscription before rolling back? If the publisher
runs COMMIT/ROLLBACK PREPARED soon, the resumed apply worker raises
"prepared transaction ... does not exist" error.

Best regards,
Hayato Kuroda
FUJITSU LIMITED







^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 05:25     ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
@ 2026-11-17 06:26       ` shveta malik <shveta.malik@gmail.com>
  2026-11-17 06:59         ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  1 sibling, 1 reply; 15+ messages in thread

From: shveta malik @ 2026-11-17 06:26 UTC (permalink / raw)
  To: Zhijie Hou <houzhijie22@gmail.com>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>; Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>; shveta malik <shvetamalik@gmail.com>

I looked at v2 and have a few suggestions, which you can take if you agree.

1)
+ This situation is not
+          detected as a deadlock, so replication can remain stalled
+          indefinitely.

How about a little elaborate:

Because the prepared transaction is not waiting on any lock itself,
this is not detected as a deadlock, and replication can remain stalled
indefinitely.

2)

+          indefinitely.  To resolve this, either cancel the waiting session,
+          or manually roll back the prepared transaction on the subscriber,
+          disable <literal>two_phase</literal> (see
+          <link
linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION
... SET</literal></link>)
+          until that transaction is committed on the publisher and replicated
+          again, and then re-enable <literal>two_phase</literal> if required.
+         </para>


--We can separate 2 suggestions, else it becomes difficult to
understand (at-least I find it difficult).
--Also we can improve second suggestion a bit.

How about:

To recover, preferably cancel the waiting session, allowing the apply
worker to proceed and complete the prepared transaction normally.
Alternatively, execute ROLLBACK PREPARED on the subscriber to release
the locks. However, this discards the changes made by the prepared
transaction
on the subscriber, so the transaction must be re-applied once it is
committed on the publisher, to keep the subscriber consistent with the
publisher. To achieve this, temporarily disable two_phase using ALTER
SUBSCRIPTION ... SET until the transaction is committed on the
publisher and replicated to the subscriber, then re-enable it.

thanks
Shveta






^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 05:25     ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
  2026-11-17 06:26       ` Re: Document prepared transaction lock waits with two_phase subscriptions shveta malik <shveta.malik@gmail.com>
@ 2026-11-17 06:59         ` Zhijie Hou <houzhijie22@gmail.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Zhijie Hou @ 2026-11-17 06:59 UTC (permalink / raw)
  To: shveta malik <shveta.malik@gmail.com>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>; Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>; shveta malik <shvetamalik@gmail.com>

Hi,

On Tue, Nov17, 2026 at 02:26 PM shveta malik wrote:
> I looked at v2 and have a few suggestions, which you can take if you agree.

Thanks for the comments.

> 1)
> + This situation is not
> +          detected as a deadlock, so replication can remain stalled
> +          indefinitely.
>
> How about a little elaborate:
>
> Because the prepared transaction is not waiting on any lock itself,
> this is not detected as a deadlock, and replication can remain stalled
> indefinitely.

I think if a transaction can be prepared, it naturally means it doesn't 
conflict with the others, so I'd keep the current version in the patch.


>
> 2)
>
> +          indefinitely.  To resolve this, either cancel the waiting session,
> +          or manually roll back the prepared transaction on the subscriber,
> +          disable <literal>two_phase</literal> (see
> +          <link
> linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION
> ... SET</literal></link>)
> +          until that transaction is committed on the publisher and replicated
> +          again, and then re-enable <literal>two_phase</literal> if required.
> +         </para>
>
>
> --We can separate 2 suggestions, else it becomes difficult to
> understand (at-least I find it difficult).

Agreed.

> --Also we can improve second suggestion a bit.
>
> How about:
>
> To recover, preferably cancel the waiting session, allowing the apply
> worker to proceed and complete the prepared transaction normally.
> Alternatively, execute ROLLBACK PREPARED on the subscriber to release
> the locks. However, this discards the changes made by the prepared
> transaction on the subscriber, so the transaction must be re-applied
> once it is committed on the publisher, to keep the subscriber
> consistent with the publisher. To achieve this, temporarily disable
> two_phase using ALTER SUBSCRIPTION ... SET until the transaction is
> committed on the publisher and replicated to the subscriber, then
> re-enable it.

The proposed text for the second point feels a bit verbose to me. I'd 
prefer to keep it short and clean.


-- 
Best Regards,
Zhijie Hou






^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 05:25     ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
@ 2026-11-17 06:58       ` Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 09:44         ` Re: Document prepared transaction lock waits with two_phase subscriptions Nisha Moond <nisha.moond412@gmail.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Zhijie Hou @ 2026-11-17 06:58 UTC (permalink / raw)
  To: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; +Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

Hi,

On Tue, Nov17, 2026 at 01:25 PM "Hayato Kuroda (Fujitsu)" wrote:
>
> Thanks for posting the patch. I feel the logging should be improved,
> but it might be out-of-scope. Here I focused on the doc patch.

Thanks for the comments.

>
> ```
> +          or manually roll back the prepared transaction on the subscriber,
> +          disable <literal>two_phase</literal> (see
> +          <link linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION ... SET</literal></link>)
> +          until that transaction is committed on the publisher and replicated
> +          again, and then re-enable <literal>two_phase</literal> if required.
> ```
>
> Isn't it better to disable the subscription before rolling back? If
> the publisher runs COMMIT/ROLLBACK PREPARED soon, the resumed apply
> worker raises "prepared transaction ... does not exist" error.

Although I think the ERROR won't affect the recoevry steps as the 
transaction can be replicated anyway after disabling the two_phase, I 
agree that the suggested order looks cleaner, so changed.

Here is the V3 patches for all branches.


-- 
Best Regards,
Zhijie Hou

Attachments: download all (2 files, .tar.gz)

v3-0001-Document-prepared-transaction-lock-waits-with-two-HEAD-PG18.patch (text/plain, 4.0K) download From d1610a4d7be6cf1f6c8d9ee83b99c80855a19fe6 Mon Sep 17 00:00:00 2001 From: Zhijie Hou <houzhijie22@gmail.com> Date: Tue, 17 Nov 2026 14:52:29 +0800 Subject: [PATCH v3] Document prepared transaction lock waits with two_phase subscriptions. When two_phase is enabled for a subscription, a transaction prepared by the apply worker continues to hold its locks until COMMIT PREPARED or ROLLBACK PREPARED is applied. If another session requests a conflicting lock on a table modified by that prepared transaction, it waits behind the prepared transaction, and subsequent conflicting lock requests by the apply worker on the same table queue behind that session. Because the prepared transaction is not waiting on any lock, this situation is not detected as a deadlock and replication can remain stalled indefinitely. Document this caveat and how to recover from it under CREATE SUBSCRIPTION and PREPARE TRANSACTION. --- doc/src/sgml/ref/create_subscription.sgml | 23 +++++++++++++++++++++++ doc/src/sgml/ref/prepare_transaction.sgml | 6 +++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index 6248c228a64..1e8bb843410 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -424,6 +424,29 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl are then processed immediately by the subscriber. </para> + <para> + A prepared transaction applied on the subscriber keeps its locks + until the apply worker processes the corresponding + <command>COMMIT PREPARED</command> or <command>ROLLBACK + PREPARED</command>. If another session requests a conflicting lock + on a table modified by such a transaction (for example, with + <command>LOCK</command>, <command>TRUNCATE</command>, or + <command>ALTER TABLE</command>), it has to wait, and later + conflicting lock requests on that table, including the apply + worker's own next change to it, queue behind it. The apply worker + then cannot reach the <command>COMMIT PREPARED</command> or + <command>ROLLBACK PREPARED</command>. This situation is not + detected as a deadlock, so replication can remain stalled + indefinitely. To resolve this, cancel the waiting session. + Alternatively, disable the subscription, manually roll back the + prepared transaction on the subscriber, disable + <literal>two_phase</literal> (see + <link linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION ... SET</literal></link>), + and re-enable the subscription. Once the transaction is finished + on the publisher and replicated again, <literal>two_phase</literal> + can be re-enabled if required. + </para> + <para> The implementation of two-phase commit requires that replication has successfully finished the initial table synchronization diff --git a/doc/src/sgml/ref/prepare_transaction.sgml b/doc/src/sgml/ref/prepare_transaction.sgml index f4f6118ac31..a9778866496 100644 --- a/doc/src/sgml/ref/prepare_transaction.sgml +++ b/doc/src/sgml/ref/prepare_transaction.sgml @@ -132,7 +132,11 @@ PREPARE TRANSACTION <replaceable class="parameter">transaction_id</replaceable> continues to hold whatever locks it held. The intended usage of the feature is that a prepared transaction will normally be committed or rolled back as soon as an external transaction manager has verified that - other databases are also prepared to commit. + other databases are also prepared to commit. A transaction prepared by a + logical replication apply worker is normally completed by the + subscription's apply worker; see + <xref linkend="sql-createsubscription-params-with-two-phase"/> for a + lock wait this can cause. </para> <para> -- 2.54.0 (Apple Git-157)
v3-0001-Document-prepared-transaction-lock-waits-with-two-PG15-PG17.patch (text/plain, 3.5K) download From e310e98909e4ab8fac999793865d73d9d58831ae Mon Sep 17 00:00:00 2001 From: Zhijie Hou <houzhijie22@gmail.com> Date: Tue, 17 Nov 2026 13:48:18 +0800 Subject: [PATCH v3] Document prepared transaction lock waits with two_phase subscriptions. When two_phase is enabled for a subscription, a transaction prepared by the apply worker continues to hold its locks until COMMIT PREPARED or ROLLBACK PREPARED is applied. If another session requests a conflicting lock on a table modified by that prepared transaction, it waits behind the prepared transaction, and subsequent conflicting lock requests by the apply worker on the same table queue behind that session. Because the prepared transaction is not waiting on any lock, this situation is not detected as a deadlock and replication can remain stalled indefinitely. Document this caveat and how to recover from it under CREATE SUBSCRIPTION and PREPARE TRANSACTION. --- doc/src/sgml/ref/create_subscription.sgml | 16 ++++++++++++++++ doc/src/sgml/ref/prepare_transaction.sgml | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index c9c8dd440dc..3d18ad60458 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -343,6 +343,22 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl are then processed immediately by the subscriber. </para> + <para> + A prepared transaction applied on the subscriber keeps its locks + until the apply worker processes the corresponding + <command>COMMIT PREPARED</command> or <command>ROLLBACK + PREPARED</command>. If another session requests a conflicting lock + on a table modified by such a transaction (for example, with + <command>LOCK</command>, <command>TRUNCATE</command>, or + <command>ALTER TABLE</command>), it has to wait, and later + conflicting lock requests on that table, including the apply + worker's own next change to it, queue behind it. The apply worker + then cannot reach the <command>COMMIT PREPARED</command> or + <command>ROLLBACK PREPARED</command>. This situation is not + detected as a deadlock, so replication can remain stalled + indefinitely until the waiting session is canceled. + </para> + <para> The implementation of two-phase commit requires that replication has successfully finished the initial table synchronization diff --git a/doc/src/sgml/ref/prepare_transaction.sgml b/doc/src/sgml/ref/prepare_transaction.sgml index f4f6118ac31..c3848fbc72c 100644 --- a/doc/src/sgml/ref/prepare_transaction.sgml +++ b/doc/src/sgml/ref/prepare_transaction.sgml @@ -132,7 +132,11 @@ PREPARE TRANSACTION <replaceable class="parameter">transaction_id</replaceable> continues to hold whatever locks it held. The intended usage of the feature is that a prepared transaction will normally be committed or rolled back as soon as an external transaction manager has verified that - other databases are also prepared to commit. + other databases are also prepared to commit. A transaction prepared by a + logical replication apply worker is normally completed by the + subscription's apply worker; see the <literal>two_phase</literal> + parameter of <xref linkend="sql-createsubscription"/> for a lock wait + this can cause. </para> <para> -- 2.54.0 (Apple Git-157)
^ permalink raw reply [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 05:25     ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
  2026-11-17 06:58       ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
@ 2026-11-17 09:44         ` Nisha Moond <nisha.moond412@gmail.com>
  2026-11-17 12:20           ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Nisha Moond @ 2026-11-17 09:44 UTC (permalink / raw)
  To: Zhijie Hou <houzhijie22@gmail.com>; +Cc: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

On Tue, Nov 17, 2026 at 12:29 PM Zhijie Hou <houzhijie22@gmail.com> wrote:
>
> Here is the V3 patches for all branches.
>
>

Thanks for the patch. +1 for documenting this. The doc change looks
good to me. I have one suggestion:

+          and re-enable the subscription.  Once the transaction is finished
+          on the publisher and replicated again, <literal>two_phase</literal>
+          can be re-enabled if required.

I don't think we need to wait for the prepared transaction to finish
on the publisher. two_phase can be re-enabled right after it is
disabled, while the subscription is still disabled, and the
transaction is still replicated correctly when the publisher commits
it. (Confirmed by test)

This works because re-enabling two_phase sets the slot's two_phase_at
to where replication resumes. The subscriber had already applied the
PREPARE, so that point is after it. The publisher then sends the whole
transaction at commit time.
So the steps could be:

           Alternatively, disable the subscription, manually roll back the
-          prepared transaction on the subscriber, disable
+          prepared transaction on the subscriber, disable and then re-enable
           <literal>two_phase</literal> (see
           <link
linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION
... SET</literal></link>),
-          and re-enable the subscription.  Once the transaction is finished
-          on the publisher and replicated again, <literal>two_phase</literal>
-          can be re-enabled if required.
+          and re-enable the subscription.  The transaction is replicated again
+          when it is committed on the publisher.
          </para>

Thoughts?

--
Thanks,
Nisha






^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 05:25     ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
  2026-11-17 06:58       ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 09:44         ` Re: Document prepared transaction lock waits with two_phase subscriptions Nisha Moond <nisha.moond412@gmail.com>
@ 2026-11-17 12:20           ` Zhijie Hou <houzhijie22@gmail.com>
  2026-11-18 05:19             ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Zhijie Hou @ 2026-11-17 12:20 UTC (permalink / raw)
  To: Nisha Moond <nisha.moond412@gmail.com>; +Cc: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

Hi,

On Tue, Nov17, 2026 at 05:44 PM Nisha Moond wrote:
> On Tue, Nov 17, 2026 at 12:29 PM Zhijie Hou <houzhijie22@gmail.com> wrote:
> >
>
> Thanks for the patch. +1 for documenting this. The doc change looks
> good to me. I have one suggestion:
>
> +          and re-enable the subscription.  Once the transaction is finished
> +          on the publisher and replicated again, <literal>two_phase</literal>
> +          can be re-enabled if required.
>
> I don't think we need to wait for the prepared transaction to finish
> on the publisher. two_phase can be re-enabled right after it is
> disabled, while the subscription is still disabled, and the
> transaction is still replicated correctly when the publisher commits
> it. (Confirmed by test)
>
> This works because re-enabling two_phase sets the slot's two_phase_at
> to where replication resumes. The subscriber had already applied the
> PREPARE, so that point is after it. The publisher then sends the whole
> transaction at commit time.
> So the steps could be:
>
>             Alternatively, disable the subscription, manually roll back the
> -          prepared transaction on the subscriber, disable
> +          prepared transaction on the subscriber, disable and then re-enable
>             <literal>two_phase</literal> (see
>             <link
> linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION
> ... SET</literal></link>),
> -          and re-enable the subscription.  Once the transaction is finished
> -          on the publisher and replicated again, <literal>two_phase</literal>
> -          can be re-enabled if required.
> +          and re-enable the subscription.  The transaction is replicated again
> +          when it is committed on the publisher.
>            </para>
>
> Thoughts?

Agreed. Here is the updated patches.


-- 
Best Regards,
Zhijie Hou

Attachments: download all (2 files, .tar.gz)

v4-0001-Document-prepared-transaction-lock-waits-with-two-HEAD-PG18.patch (text/plain, 4.4K) download From 9c4bfb874b6e49f3664bcdfdf67e825b74451793 Mon Sep 17 00:00:00 2001 From: Zhijie Hou <houzhijie22@gmail.com> Date: Tue, 17 Nov 2026 17:51:01 +0800 Subject: [PATCH v4] Document prepared transaction lock waits with two_phase subscriptions. When two_phase is enabled for a subscription, a transaction prepared by the apply worker continues to hold its locks until COMMIT PREPARED or ROLLBACK PREPARED is applied. If another session requests a conflicting lock on a table modified by that prepared transaction, it waits behind the prepared transaction, and subsequent conflicting lock requests by the apply worker on the same table queue behind that session. Because the prepared transaction is not waiting on any lock, this situation is not detected as a deadlock and replication can remain stalled indefinitely. Document this caveat and how to recover from it under CREATE SUBSCRIPTION and PREPARE TRANSACTION. Author: Zhijie Hou <houzhijie22@gmail.com> Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: shveta malik <shveta.malik@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Nisha Moond <nisha.moond412@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/72c9b956-96c3-40a5-99bb-d9b7338c0bab@gmail.com Backpatch-through: 15 --- doc/src/sgml/ref/create_subscription.sgml | 22 ++++++++++++++++++++++ doc/src/sgml/ref/prepare_transaction.sgml | 6 +++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index 6248c228a64..92552e97009 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -424,6 +424,28 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl are then processed immediately by the subscriber. </para> + <para> + A prepared transaction applied on the subscriber keeps its locks + until the apply worker processes the corresponding + <command>COMMIT PREPARED</command> or <command>ROLLBACK + PREPARED</command>. If another session requests a conflicting lock + on a table modified by such a transaction (for example, with + <command>LOCK</command>, <command>TRUNCATE</command>, or + <command>ALTER TABLE</command>), it has to wait, and later + conflicting lock requests on that table, including the apply + worker's own next change to it, queue behind it. The apply worker + then cannot reach the <command>COMMIT PREPARED</command> or + <command>ROLLBACK PREPARED</command>. This situation is not + detected as a deadlock, so replication can remain stalled + indefinitely. To resolve this, cancel the waiting session. + Alternatively, disable the subscription, manually roll back the + prepared transaction on the subscriber, disable and then re-enable + <literal>two_phase</literal> (see + <link linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION ... SET</literal></link>), + and re-enable the subscription. The transaction is replicated again + when it is committed on the publisher. + </para> + <para> The implementation of two-phase commit requires that replication has successfully finished the initial table synchronization diff --git a/doc/src/sgml/ref/prepare_transaction.sgml b/doc/src/sgml/ref/prepare_transaction.sgml index f4f6118ac31..a9778866496 100644 --- a/doc/src/sgml/ref/prepare_transaction.sgml +++ b/doc/src/sgml/ref/prepare_transaction.sgml @@ -132,7 +132,11 @@ PREPARE TRANSACTION <replaceable class="parameter">transaction_id</replaceable> continues to hold whatever locks it held. The intended usage of the feature is that a prepared transaction will normally be committed or rolled back as soon as an external transaction manager has verified that - other databases are also prepared to commit. + other databases are also prepared to commit. A transaction prepared by a + logical replication apply worker is normally completed by the + subscription's apply worker; see + <xref linkend="sql-createsubscription-params-with-two-phase"/> for a + lock wait this can cause. </para> <para> -- 2.54.0 (Apple Git-157)
v4-0001-Document-prepared-transaction-lock-waits-with-two-PG15-PG17.patch (text/plain, 4.0K) download From e189f3d05020b898bb91fbba8bb60503e80f2e90 Mon Sep 17 00:00:00 2001 From: Zhijie Hou <houzhijie22@gmail.com> Date: Tue, 17 Nov 2026 17:03:44 +0800 Subject: [PATCH v4] Document prepared transaction lock waits with two_phase subscriptions. When two_phase is enabled for a subscription, a transaction prepared by the apply worker continues to hold its locks until COMMIT PREPARED or ROLLBACK PREPARED is applied. If another session requests a conflicting lock on a table modified by that prepared transaction, it waits behind the prepared transaction, and subsequent conflicting lock requests by the apply worker on the same table queue behind that session. Because the prepared transaction is not waiting on any lock, this situation is not detected as a deadlock and replication can remain stalled indefinitely. Document this caveat and how to recover from it under CREATE SUBSCRIPTION and PREPARE TRANSACTION. Author: Zhijie Hou <houzhijie22@gmail.com> Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: shveta malik <shveta.malik@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Nisha Moond <nisha.moond412@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/72c9b956-96c3-40a5-99bb-d9b7338c0bab@gmail.com Backpatch-through: 15 --- doc/src/sgml/ref/create_subscription.sgml | 16 ++++++++++++++++ doc/src/sgml/ref/prepare_transaction.sgml | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index c9c8dd440dc..3d18ad60458 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -343,6 +343,22 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl are then processed immediately by the subscriber. </para> + <para> + A prepared transaction applied on the subscriber keeps its locks + until the apply worker processes the corresponding + <command>COMMIT PREPARED</command> or <command>ROLLBACK + PREPARED</command>. If another session requests a conflicting lock + on a table modified by such a transaction (for example, with + <command>LOCK</command>, <command>TRUNCATE</command>, or + <command>ALTER TABLE</command>), it has to wait, and later + conflicting lock requests on that table, including the apply + worker's own next change to it, queue behind it. The apply worker + then cannot reach the <command>COMMIT PREPARED</command> or + <command>ROLLBACK PREPARED</command>. This situation is not + detected as a deadlock, so replication can remain stalled + indefinitely until the waiting session is canceled. + </para> + <para> The implementation of two-phase commit requires that replication has successfully finished the initial table synchronization diff --git a/doc/src/sgml/ref/prepare_transaction.sgml b/doc/src/sgml/ref/prepare_transaction.sgml index f4f6118ac31..c3848fbc72c 100644 --- a/doc/src/sgml/ref/prepare_transaction.sgml +++ b/doc/src/sgml/ref/prepare_transaction.sgml @@ -132,7 +132,11 @@ PREPARE TRANSACTION <replaceable class="parameter">transaction_id</replaceable> continues to hold whatever locks it held. The intended usage of the feature is that a prepared transaction will normally be committed or rolled back as soon as an external transaction manager has verified that - other databases are also prepared to commit. + other databases are also prepared to commit. A transaction prepared by a + logical replication apply worker is normally completed by the + subscription's apply worker; see the <literal>two_phase</literal> + parameter of <xref linkend="sql-createsubscription"/> for a lock wait + this can cause. </para> <para> -- 2.54.0 (Apple Git-157)
^ permalink raw reply [nested|flat] 15+ messages in thread

* RE: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 05:25     ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
  2026-11-17 06:58       ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 09:44         ` Re: Document prepared transaction lock waits with two_phase subscriptions Nisha Moond <nisha.moond412@gmail.com>
  2026-11-17 12:20           ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
@ 2026-11-18 05:19             ` Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
  2026-11-18 08:22               ` Re: Document prepared transaction lock waits with two_phase subscriptions Amit Kapila <amit.kapila16@gmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Hayato Kuroda (Fujitsu) @ 2026-11-18 05:19 UTC (permalink / raw)
  To: Zhijie Hou <houzhijie22@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; +Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; amit.kapila16@gmail.com <amit.kapila16@gmail.com>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

Hi,

Thanks for updating the patch. LGTM.

Best regards,
Hayato Kuroda
FUJITSU LIMITED



^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: Document prepared transaction lock waits with two_phase subscriptions
  2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-16 09:36 ` Re: Document prepared transaction lock waits with two_phase subscriptions Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  2026-11-16 12:20   ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 05:25     ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
  2026-11-17 06:58       ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-17 09:44         ` Re: Document prepared transaction lock waits with two_phase subscriptions Nisha Moond <nisha.moond412@gmail.com>
  2026-11-17 12:20           ` Re: Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
  2026-11-18 05:19             ` RE: Document prepared transaction lock waits with two_phase subscriptions Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
@ 2026-11-18 08:22               ` Amit Kapila <amit.kapila16@gmail.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Amit Kapila @ 2026-11-18 08:22 UTC (permalink / raw)
  To: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>; +Cc: Zhijie Hou <houzhijie22@gmail.com>; Nisha Moond <nisha.moond412@gmail.com>; Bertrand Drouvot <bertranddrouvot.pg@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>; Masahiko Sawada <sawada.mshk@gmail.com>; shveta malik <shveta.malik@gmail.com>; Dilip Kumar <dilipbalaut@gmail.com>

On Wed, Nov 18, 2026 at 10:49 AM Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> Thanks for updating the patch. LGTM.
>

Pushed.

-- 
With Regards,
Amit Kapila.






^ permalink  raw  reply  [nested|flat] 15+ messages in thread


end of thread, other threads:[~2026-11-18 08:22 UTC | newest]

Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 03:58 Document prepared transaction lock waits with two_phase subscriptions Zhijie Hou <houzhijie22@gmail.com>
2026-11-16 09:36 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-11-16 12:20   ` Zhijie Hou <houzhijie22@gmail.com>
2026-11-16 13:44     ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2026-11-17 02:53       ` Amit Kapila <amit.kapila16@gmail.com>
2026-11-17 06:49         ` Masahiko Sawada <sawada.mshk@gmail.com>
2026-11-17 07:42           ` Zhijie Hou <houzhijie22@gmail.com>
2026-11-17 05:25     ` Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
2026-11-17 06:26       ` shveta malik <shveta.malik@gmail.com>
2026-11-17 06:59         ` Zhijie Hou <houzhijie22@gmail.com>
2026-11-17 06:58       ` Zhijie Hou <houzhijie22@gmail.com>
2026-11-17 09:44         ` Nisha Moond <nisha.moond412@gmail.com>
2026-11-17 12:20           ` Zhijie Hou <houzhijie22@gmail.com>
2026-11-18 05:19             ` Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
2026-11-18 08:22               ` Amit Kapila <amit.kapila16@gmail.com>

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