pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Stabilize recovery conflict count checks in 031_recovery_conflic
Date: Mon, 05 Oct 2026 04:05:55 +0000
Message-ID: <E1xDZxb-00000000MD7-3fa5@gemulon.postgresql.org> (raw)

Stabilize recovery conflict count checks in 031_recovery_conflict.pl

Buildfarm members olingo and adder reported failures in
031_recovery_conflict.pl where a recovery conflict was counted twice.
olingo saw the snapshot conflict count reach 2 instead of 1, while adder
saw the same for the buffer pin conflict count.

The startup process can signal a standby backend again while it is
reporting a recovery-conflict FATAL error. Each processed conflict can
increment the corresponding statistic. Thus, even when the expected
conflict occurs, its counter can exceed 1. The existing poll for exactly 1
can then time out, and the exact check of the aggregate count can fail as
well.

Fix this by polling for a positive count for each conflict type and
accepting an aggregate count of at least the expected number.

Backpatch to v17, where this test was enabled.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/421c0aee-84c8-4c07-b4b9-263095479755%40gmail.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/92ee148b64ddc1685b5d0e74d5a083c0b22a6db7

Modified Files
--------------
src/test/recovery/t/031_recovery_conflict.pl | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)



view thread (4+ messages)

Message-ID: <E1xDZxb-00000000MD7-3fa5@gemulon.postgresql.org>
Permalink:  ../E1xDZxb-00000000MD7-3fa5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xDZxb-00000000MD7-3fa5@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org
  Subject: Re: pgsql: Stabilize recovery conflict count checks in 031_recovery_conflic
  In-Reply-To: <E1xDZxb-00000000MD7-3fa5@gemulon.postgresql.org>
  References: <E1xDZxb-00000000MD7-3fa5@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