Re: Bug in amcheck?

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>, Konstantin Knizhnik <knizhnik(at)garret(dot)ru>, aekorotkov(at)gmail(dot)com, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bug in amcheck?
Date: 2026-01-16 06:00:00
Message-ID: 39084040-a571-49c5-86db-ef17077f3e4a@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Tom and Heikki,

03.01.2026 04:40, Tom Lane wrote:
> Heikki Linnakangas <hlinnaka(at)iki(dot)fi> 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

Attachment Content-Type Size
debug-nbtree_half_dead_pages.patch text/x-patch 1.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-01-16 06:21:06 Re: Remove no-op PlaceHolderVars
Previous Message Japin Li 2026-01-16 05:54:44 Re: log_min_messages per backend type