pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add test to prevent premature removal of conflict-relevant data.
Date: Mon, 08 Sep 2025 12:06:49 +0000
Message-ID: <E1uvae1-0016or-2v@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6456c6e2c4ad1cf9752e09cce37bfcfe2190c5e0

Modified Files
--------------
src/backend/access/transam/twophase.c    |   6 ++
src/test/subscription/Makefile           |   4 +-
src/test/subscription/meson.build        |   5 +-
src/test/subscription/t/035_conflicts.pl | 160 +++++++++++++++++++++++++++++++
4 files changed, 173 insertions(+), 2 deletions(-)



Message-ID: <E1uvae1-0016or-2v@gemulon.postgresql.org>
Permalink:  ../E1uvae1-0016or-2v@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uvae1-0016or-2v@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add test to prevent premature removal of conflict-relevant data.
  In-Reply-To: <E1uvae1-0016or-2v@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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