postgresql/src/include/replication
Amit Kapila 1f7e9ba3ac Post-commit review fixes for 228c370868.
This commit fixes three issues:

1) When a disabled subscription is created with retain_dead_tuples set to true,
the launcher is not woken up immediately, which may lead to delays in creating
the conflict detection slot.

Creating the conflict detection slot is essential even when the subscription is
not enabled. This ensures that dead tuples are retained, which is necessary for
accurately identifying the type of conflict during replication.

2) Conflict-related data was unnecessarily retained when the subscription does
not have a table.

3) Conflict-relevant data could be prematurely removed before applying
prepared transactions on the publisher that are in the commit critical section.

This issue occurred because the backend executing COMMIT PREPARED was not
accounted for during the computation of oldestXid in the commit phase on
the publisher. As a result, the subscriber could advance the conflict
slot's xmin without waiting for such COMMIT PREPARED transactions to
complete.

We fixed this issue by identifying prepared transactions that are in the
commit critical section during computation of oldestXid in commit phase.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: shveta malik <shveta.malik@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Reviewed-by: Nisha Moond <nisha.moond412@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/OS9PR01MB16913DACB64E5721872AA5C02943BA@OS9PR01MB16913.jpnprd01.prod.outlook.com
Discussion: https://postgr.es/m/OS9PR01MB16913F67856B0DA2A909788129400A@OS9PR01MB16913.jpnprd01.prod.outlook.com
2025-09-08 06:10:15 +00:00
..
conflict.h Message wording improvements 2025-08-25 23:15:24 +02:00
decode.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
logical.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
logicallauncher.h Preserve conflict-relevant data during logical replication. 2025-07-23 02:56:00 +00:00
logicalproto.h Change publication's publish_generated_columns option type to enum. 2025-01-23 15:28:37 +05:30
logicalrelation.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
logicalworker.h Rename some signal and interrupt handling functions for consistency 2025-03-05 16:22:26 +02:00
message.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
origin.h Remove pg_replication_origin's TOAST table. 2025-05-07 14:47:36 -05:00
output_plugin.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgoutput.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
reorderbuffer.h Fix re-distributing previously distributed invalidation messages during logical decoding. 2025-06-16 17:36:01 -07:00
slot.h Change ReplicationSlotPersistentData's "synced" member to a bool. 2025-09-02 16:53:54 -05:00
slotsync.h pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
snapbuild.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
snapbuild_internal.h pg_logicalinspect: Fix possible crash when passing a directory path. 2025-03-11 09:56:40 -07:00
syncrep.h Return yyparse() result not via global variable 2025-01-24 06:55:39 +01:00
walreceiver.h Use standard die() signal handler in walreceiver 2025-04-04 12:38:32 +03:00
walsender.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
walsender_private.h Fix race with synchronous_standby_names at startup 2025-04-11 10:00:21 +09:00
worker_internal.h Post-commit review fixes for 228c370868. 2025-09-08 06:10:15 +00:00