Re: Bug in amcheck?
Mikhail Nikalayeu <mihailnikalayeu@gmail.com>
From: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
To: Konstantin Knizhnik <knizhnik@garret.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-02T12:27:00Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix amcheck's handling of half-dead B-tree pages
- fbb4b607832d 14.21 landed
- 7792bdc45860 15.16 landed
- 1829016268c3 16.12 landed
- e8ae594458a3 17.8 landed
- 19e786727c4f 18.2 landed
- cbe04e5d729f 19 (unreleased) landed
-
Fix amcheck's handling of incomplete root splits in B-tree
- a4cb21ea9cd7 14.21 landed
- 721b58fbec5f 15.16 landed
- f2a6df9fd56d 16.12 landed
- 5a2d1df00718 17.8 landed
- 50c63ebb05fc 18.2 landed
- 6c05ef5729c0 19 (unreleased) landed
-
Add a test for half-dead pages in B-tree indexes
- c085aab27819 19 (unreleased) landed
-
Add a test for incomplete splits in B-tree indexes
- 1e4e5783e7d7 19 (unreleased) landed
-
Improve checking of child pages in contrib/amcheck.
- d114cc538715 13.0 cited
Hello! > I wonder if we should add P_ISHALFDEAD(opaque) for child page? I am not a btree expert, but things I was able to find so far: In commit d114cc538715e14d29d6de8b6ea1a1d5d3e0edb4 next check is added: > bt_child_highkey_check(state, downlinkoffnum, > child, topaque->btpo_level); At the same time there is a comment below: > * We go ahead with our checks if the child page is half-dead. It's safe > * to do so because we do not test the child's high key, so it does not > * matter that the original high key will have been replaced by a dummy > * truncated high key within _bt_mark_page_halfdead(). All other page > * items are left intact on a half-dead page, so there is still something > * to test. So, yes, it looks like we need to skip the child's high key test for half-dead pages. BWT, have you tried to create an injection_point-based reproducer? Best regards, Mikhail.