Add test to prevent premature removal of conflict-relevant data.
Amit Kapila <akapila@postgresql.org>
Add test to prevent premature removal of conflict-relevant data. A test has been added to ensure that conflict-relevant data is not prematurely removed when a concurrent prepared transaction is being committed on the publisher. This test introduces an injection point that simulates the presence of a prepared transaction in the commit phase, validating that the system correctly delays conflict slot advancement until the transaction is fully committed. Additionally, the test serves as a safeguard for developers, ensuring that the acquisition of the commit timestamp does not occur before marking DELAY_CHKPT_IN_COMMIT in RecordTransactionCommitPrepared. Reported-by: Robert Haas <robertmhaas@gmail.com> Author: Zhijie Hou <houzj.fnst@fujitsu.com> Reviewed-by: shveta malik <shveta.malik@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/OS9PR01MB16913F67856B0DA2A909788129400A@OS9PR01MB16913.jpnprd01.prod.outlook.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/twophase.c | modified | +6 −0 |
| src/test/subscription/Makefile | modified | +3 −1 |
| src/test/subscription/meson.build | modified | +4 −1 |
| src/test/subscription/t/035_conflicts.pl | modified | +160 −0 |
Discussion
- Conflict detection for update_deleted in logical replication 432 messages · 2024-09-05 → 2025-09-16