The retain_dead_tuples feature waits for concurrent transactions to be applied before advancing conflict_detection_slot.xmin. It gets the WAL write position from the publisher and waits until the apply remote position passes it. This ensures that dead tuples, commit timestamps, and origins needed for conflict detection (update_deleted, update_origin_differs, and delete_origin_differs) are retained while those transactions are applied. However, with asynchronous commit enabled on the publisher, a committed transaction may not have updated the WAL write position yet. As a result, the reported WAL position can lag behind the latest committed transaction. This can cause conflict_detection_slot.xmin to advance prematurely, allowing dead tuples needed for conflict detection to be removed before subsequent asynchronously committed transactions are applied. Report the end of the last inserted WAL record instead. A transaction inserts its commit record before it is marked committed, so the insert position cannot be behind a transaction that has already committed. Transactions that have entered the commit phase but have not yet inserted their commit record are still accounted for by the in-commit transaction ID reported in the same message. In addition to above, add missing trailing period to update_deleted conflict detail messages which are added for the same feature. Reported-by: Nisha Moond <nisha.moond412@gmail.com> Author: Zhijie Hou <houzj.fnst@fujitsu.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/TY4PR01MB177182F547A62FC2666EC04EC94B72@TY4PR01MB17718.jpnprd01.prod.outlook.com Backpatch-through: 19, where it was introduced
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/19/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/19/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.