agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Stabilize recovery conflict stats checks in 031_recovery_conflic
Date: Thu, 03 Sep 2026 03:18:34 +0000
Message-ID: <E1x1xyD-00000003GDv-1EkW@gemulon.postgresql.org> (raw)
Stabilize recovery conflict stats checks in 031_recovery_conflict.pl
The buildfarm member akepa reported a failure in the
031_recovery_conflict.pl test.
The test checked pg_stat_database_conflicts immediately after detecting
a recovery conflict in the standby log. However, the conflict counter is
flushed by the canceled backend during backend exit, so WAL replay
completion and the log message did not guarantee that the updated
statistics are visible yet. So, previously, the test could see a conflict
counter of 0 even though the conflict had already occurred, triggering
the test failure.
Fix this by polling for the expected conflict counter instead of reading
it only once, handling the asynchronous pgstats update.
Per buildfarm member akepa.
Backpatch to v17, where this test is enabled and has the same race.
Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwHmiLNRfvJDAR=PmxQgf7DbzPSO1M-1RoqO8oy=t2G5KA@mail.gmail.com
Backpatch-through: 17
Branch
------
REL_17_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/a830fa886cee8b5c366787c50aadb1d5f17b2348
Modified Files
--------------
src/test/recovery/t/031_recovery_conflict.pl | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
view thread (4+ messages)
Message-ID: <E1x1xyD-00000003GDv-1EkW@gemulon.postgresql.org>
Permalink: ../E1x1xyD-00000003GDv-1EkW@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1x1xyD-00000003GDv-1EkW@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: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Stabilize recovery conflict stats checks in 031_recovery_conflic
In-Reply-To: <E1x1xyD-00000003GDv-1EkW@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox