pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Doc: Explain prepared transaction lock waits with two_phase subs
6+ messages / 1 participants
[nested] [flat]

* pgsql: Doc: Explain prepared transaction lock waits with two_phase subs
@ 2026-11-18 05:19 Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Kapila @ 2026-11-18 05:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Doc: Explain prepared transaction lock waits with two_phase subscriptions.

A transaction prepared by the apply worker retains its locks until the
corresponding COMMIT PREPARED or ROLLBACK PREPARED is applied. If another
session waits for a conflicting lock held by the prepared transaction, the
apply worker's subsequent conflicting lock requests can queue behind that
session. This can prevent the apply worker from reaching the
COMMIT PREPARED or ROLLBACK PREPARED that would release the prepared
transaction's locks.

The deadlock detector cannot detect this situation because a prepared
transaction does not wait for any locks and therefore cannot participate
in a deadlock cycle. As a result, replication can remain stalled
indefinitely.

Document this behavior and the recovery procedure 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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f03a0f879631d2e310f01d9bf0016d5298f4dbe0

Modified Files
--------------
doc/src/sgml/ref/create_subscription.sgml | 22 ++++++++++++++++++++++
doc/src/sgml/ref/prepare_transaction.sgml |  6 +++++-
2 files changed, 27 insertions(+), 1 deletion(-)



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

* pgsql: Doc: Explain prepared transaction lock waits with two_phase subs
@ 2026-11-18 05:19 Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Kapila @ 2026-11-18 05:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Doc: Explain prepared transaction lock waits with two_phase subscriptions.

A transaction prepared by the apply worker retains its locks until the
corresponding COMMIT PREPARED or ROLLBACK PREPARED is applied. If another
session waits for a conflicting lock held by the prepared transaction, the
apply worker's subsequent conflicting lock requests can queue behind that
session. This can prevent the apply worker from reaching the
COMMIT PREPARED or ROLLBACK PREPARED that would release the prepared
transaction's locks.

The deadlock detector cannot detect this situation because a prepared
transaction does not wait for any locks and therefore cannot participate
in a deadlock cycle. As a result, replication can remain stalled
indefinitely.

Document this behavior and the recovery procedure 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

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3ec081c4ccabd6c918761148e5a1fa5fd2db60a2

Modified Files
--------------
doc/src/sgml/ref/create_subscription.sgml | 22 ++++++++++++++++++++++
doc/src/sgml/ref/prepare_transaction.sgml |  6 +++++-
2 files changed, 27 insertions(+), 1 deletion(-)



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

* pgsql: Doc: Explain prepared transaction lock waits with two_phase subs
@ 2026-11-18 05:19 Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Kapila @ 2026-11-18 05:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Doc: Explain prepared transaction lock waits with two_phase subscriptions.

A transaction prepared by the apply worker retains its locks until the
corresponding COMMIT PREPARED or ROLLBACK PREPARED is applied. If another
session waits for a conflicting lock held by the prepared transaction, the
apply worker's subsequent conflicting lock requests can queue behind that
session. This can prevent the apply worker from reaching the
COMMIT PREPARED or ROLLBACK PREPARED that would release the prepared
transaction's locks.

The deadlock detector cannot detect this situation because a prepared
transaction does not wait for any locks and therefore cannot participate
in a deadlock cycle. As a result, replication can remain stalled
indefinitely.

Document this behavior and the recovery procedure 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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/94fc1c08f5f72c115a94246370303454ef23dd4f

Modified Files
--------------
doc/src/sgml/ref/create_subscription.sgml | 22 ++++++++++++++++++++++
doc/src/sgml/ref/prepare_transaction.sgml |  6 +++++-
2 files changed, 27 insertions(+), 1 deletion(-)



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

* pgsql: Doc: Explain prepared transaction lock waits with two_phase subs
@ 2026-11-18 05:19 Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Kapila @ 2026-11-18 05:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Doc: Explain prepared transaction lock waits with two_phase subscriptions.

A transaction prepared by the apply worker retains its locks until the
corresponding COMMIT PREPARED or ROLLBACK PREPARED is applied. If another
session waits for a conflicting lock held by the prepared transaction, the
apply worker's subsequent conflicting lock requests can queue behind that
session. This can prevent the apply worker from reaching the
COMMIT PREPARED or ROLLBACK PREPARED that would release the prepared
transaction's locks.

The deadlock detector cannot detect this situation because a prepared
transaction does not wait for any locks and therefore cannot participate
in a deadlock cycle. As a result, replication can remain stalled
indefinitely.

Document this behavior and the recovery procedure 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

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2490a756460460eaf5a3636993257bee47347f41

Modified Files
--------------
doc/src/sgml/ref/create_subscription.sgml | 16 ++++++++++++++++
doc/src/sgml/ref/prepare_transaction.sgml |  6 +++++-
2 files changed, 21 insertions(+), 1 deletion(-)



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

* pgsql: Doc: Explain prepared transaction lock waits with two_phase subs
@ 2026-11-18 05:19 Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Kapila @ 2026-11-18 05:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Doc: Explain prepared transaction lock waits with two_phase subscriptions.

A transaction prepared by the apply worker retains its locks until the
corresponding COMMIT PREPARED or ROLLBACK PREPARED is applied. If another
session waits for a conflicting lock held by the prepared transaction, the
apply worker's subsequent conflicting lock requests can queue behind that
session. This can prevent the apply worker from reaching the
COMMIT PREPARED or ROLLBACK PREPARED that would release the prepared
transaction's locks.

The deadlock detector cannot detect this situation because a prepared
transaction does not wait for any locks and therefore cannot participate
in a deadlock cycle. As a result, replication can remain stalled
indefinitely.

Document this behavior and the recovery procedure 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

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d4f29ef8005b93478bd1dbcb8f41e5821e016743

Modified Files
--------------
doc/src/sgml/ref/create_subscription.sgml | 16 ++++++++++++++++
doc/src/sgml/ref/prepare_transaction.sgml |  6 +++++-
2 files changed, 21 insertions(+), 1 deletion(-)



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

* pgsql: Doc: Explain prepared transaction lock waits with two_phase subs
@ 2026-11-18 05:19 Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Kapila @ 2026-11-18 05:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Doc: Explain prepared transaction lock waits with two_phase subscriptions.

A transaction prepared by the apply worker retains its locks until the
corresponding COMMIT PREPARED or ROLLBACK PREPARED is applied. If another
session waits for a conflicting lock held by the prepared transaction, the
apply worker's subsequent conflicting lock requests can queue behind that
session. This can prevent the apply worker from reaching the
COMMIT PREPARED or ROLLBACK PREPARED that would release the prepared
transaction's locks.

The deadlock detector cannot detect this situation because a prepared
transaction does not wait for any locks and therefore cannot participate
in a deadlock cycle. As a result, replication can remain stalled
indefinitely.

Document this behavior and the recovery procedure 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

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/75a43054370062a37ce3a436d78922565336a1ab

Modified Files
--------------
doc/src/sgml/ref/create_subscription.sgml | 16 ++++++++++++++++
doc/src/sgml/ref/prepare_transaction.sgml |  6 +++++-
2 files changed, 21 insertions(+), 1 deletion(-)



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


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

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 05:19 pgsql: Doc: Explain prepared transaction lock waits with two_phase subs Amit Kapila <akapila@postgresql.org>
2026-11-18 05:19 pgsql: Doc: Explain prepared transaction lock waits with two_phase subs Amit Kapila <akapila@postgresql.org>
2026-11-18 05:19 pgsql: Doc: Explain prepared transaction lock waits with two_phase subs Amit Kapila <akapila@postgresql.org>
2026-11-18 05:19 pgsql: Doc: Explain prepared transaction lock waits with two_phase subs Amit Kapila <akapila@postgresql.org>
2026-11-18 05:19 pgsql: Doc: Explain prepared transaction lock waits with two_phase subs Amit Kapila <akapila@postgresql.org>
2026-11-18 05:19 pgsql: Doc: Explain prepared transaction lock waits with two_phase subs Amit Kapila <akapila@postgresql.org>

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