Hello Tom and Heikki,
03.01.2026 04:40, Tom Lane wrote:
Heikki Linnakangas <[email protected]> writes:
On 02/12/2025 19:59, Peter Geoghegan wrote:
These tests will increase nbtree code coverage quite a bit, which is a
nice bonus.
Committed, thanks for the review!
In the past couple of days, scorpion and skink have failed
the nbtree_half_dead_pages test with identical symptoms [1][2]:
...
[1]
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=scorpion&dt=2026-01-02%2004%3A54%3A38
[2]
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2025-12-31%2003%3A34%3A51
I reproduced such failures locally (when running multiple test
instances under Valgrind concurrently) and discovered that the test might
fail due to autovacuum activity. (Apparently because
heap_prune_satisfies_vacuum() returns HEAPTUPLE_RECENTLY_DEAD, not
HEAPTUPLE_DEAD for tuples in question, so prune_freeze_plan()/
heap_page_prune_and_freeze() finds 0 lpdead_items.)
pgsql.build/testrun/nbtree/regress/log/postmaster.log in [2] contains:
2025-12-31 06:00:41.778 CET autovacuum worker[2250984] LOG: automatic analyze of table
"template1.information_schema.sql_features"
(The postmaster log is missing in [1] for some reason...)
I've also managed to reproduce this just with the attached patch and:
echo "autovacuum_naptime = 1" > /tmp/temp.config
TEMP_CONFIG=/tmp/temp.config make -s check -C src/test/modules/nbtree
ok 86 - nbtree_half_dead_pages 319 ms
not ok 87 - nbtree_half_dead_pages 324 ms
ok 88 - nbtree_half_dead_pages 326 ms
...
# 1 of 101 tests failed.
Best regards,
Alexander
diff --git a/src/test/modules/nbtree/Makefile b/src/test/modules/nbtree/Makefile
index eec264b16a4..95af9b05df9 100644
--- a/src/test/modules/nbtree/Makefile
+++ b/src/test/modules/nbtree/Makefile
@@ -2,7 +2,7 @@
EXTRA_INSTALL = src/test/modules/injection_points contrib/amcheck
-REGRESS = nbtree_half_dead_pages \
+REGRESS = $(shell printf 'nbtree_half_dead_pages %.0s' `seq 100`) \
nbtree_incomplete_splits
ifdef USE_PGXS
diff --git a/src/test/modules/nbtree/expected/nbtree_half_dead_pages.out b/src/test/modules/nbtree/expected/nbtree_half_dead_pages.out
index c435af7a4a5..5d8b5958b19 100644
--- a/src/test/modules/nbtree/expected/nbtree_half_dead_pages.out
+++ b/src/test/modules/nbtree/expected/nbtree_half_dead_pages.out
@@ -12,6 +12,7 @@
set client_min_messages TO 'warning';
create extension if not exists injection_points;
create extension if not exists amcheck;
+drop table if exists nbtree_half_dead_pages;
reset client_min_messages;
-- Make all injection points local to this process, for concurrency.
SELECT injection_points_set_local();
diff --git a/src/test/modules/nbtree/sql/nbtree_half_dead_pages.sql b/src/test/modules/nbtree/sql/nbtree_half_dead_pages.sql
index b39cf275557..f6fc4c4777e 100644
--- a/src/test/modules/nbtree/sql/nbtree_half_dead_pages.sql
+++ b/src/test/modules/nbtree/sql/nbtree_half_dead_pages.sql
@@ -13,6 +13,7 @@
set client_min_messages TO 'warning';
create extension if not exists injection_points;
create extension if not exists amcheck;
+drop table if exists nbtree_half_dead_pages;
reset client_min_messages;
-- Make all injection points local to this process, for concurrency.