agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix autovacuum-induced flakiness in backwards scan test.
Date: Wed, 29 Jul 2026 15:17:44 +0000
Message-ID: <E1wp62S-00000000oPN-3Wqq@gemulon.postgresql.org> (raw)

Fix autovacuum-induced flakiness in backwards scan test.

Two of the permutations in backwards-scan-concurrent-splits rely on
their VACUUM step deleting the leaf pages that the waiting backwards
scan will have to recover from.  VACUUM can only do that when it's able
to remove the index tuples whose heap tuples the concurrent session just
deleted.  An autovacuum worker holding a snapshot holds back the
removable cutoff, which leaves the pages non-empty, and so undeleted,
causing the test to fail spuriously.

To fix, wait for the removable cutoff to advance past the deletions
before the scan acquires its snapshot.  This is much like commit
1c64d2fc, which dealt with the same hazard in nbtree_half_dead_pages by
adding the wait_prunable() helper that we reuse here.

Oversight in commit e395fbd3.

Author: Peter Geoghegan <pg@bowt.ie>
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/b61d9944-d7a3-45f3-b69a-f18c8bfbbbd0@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/23a6e25593729feaafb6f3491a1222247f6e0125

Modified Files
--------------
.../expected/backwards-scan-concurrent-splits.out  |  6 ++++--
.../specs/backwards-scan-concurrent-splits.spec    | 24 ++++++++++++++++++++++
2 files changed, 28 insertions(+), 2 deletions(-)



Message-ID: <E1wp62S-00000000oPN-3Wqq@gemulon.postgresql.org>
Permalink:  ../E1wp62S-00000000oPN-3Wqq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wp62S-00000000oPN-3Wqq@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: pg@bowt.ie, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix autovacuum-induced flakiness in backwards scan test.
  In-Reply-To: <E1wp62S-00000000oPN-3Wqq@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