pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make two-phase tests of ECPG and main suite more concurrent-proo
Date: Mon, 29 Apr 2024 12:12:00 +0000
Message-ID: <E1s1PrT-000cLd-TV@gemulon.postgresql.org> (raw)

Make two-phase tests of ECPG and main suite more concurrent-proof

The ECPG and main 2PC tests have been using rather-generic names for the
prepared transactions they generate.  This commit switches the 2PC
transactions to use more complex GIDs, reducing the risk of naming
conflicts.

The main 2PC tests also include scans of pg_prepared_xacts that do not
apply filters on the GID of the prepared transactions, making it
possible to fail the test when any 2PC transaction runs concurrently.
The CI has been able to see such failures with an installcheck
running the ECPG and the main regression test suites in parallel.  The
queries on pg_prepared_xacts gain quals to only look after the GIDs
generated locally.

The race is very hard to reproduce, so no backbatch is done for now.

Reported-by: Richard Guo
Discussion: https://postgr.es/m/CAMbWs4-mWCGbbE_bne5=AfqjYGDaUZmjCw2+soLjrdNA0xUDFw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7e61e4cc7cfcf2a34f063094aeab01fdba7b65f6

Modified Files
--------------
src/interfaces/ecpg/test/expected/sql-twophase.c   |  4 +-
.../ecpg/test/expected/sql-twophase.stderr         |  4 +-
src/interfaces/ecpg/test/sql/twophase.pgc          |  4 +-
src/test/regress/expected/prepared_xacts.out       | 98 +++++++++++-----------
src/test/regress/expected/prepared_xacts_1.out     | 62 +++++++-------
src/test/regress/sql/prepared_xacts.sql            | 50 +++++------
6 files changed, 111 insertions(+), 111 deletions(-)



view thread (2+ messages)

Message-ID: <E1s1PrT-000cLd-TV@gemulon.postgresql.org>
Permalink:  ../E1s1PrT-000cLd-TV@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1s1PrT-000cLd-TV@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: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Make two-phase tests of ECPG and main suite more concurrent-proo
  In-Reply-To: <E1s1PrT-000cLd-TV@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