Re: Bug in amcheck?

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Mihail Nikalayeu <mihailnikalayeu@gmail.com>, Konstantin Knizhnik <knizhnik@garret.ru>, akorotkov@postgresql.org, aekorotkov@gmail.com, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-02T19:27:09Z
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 →
  1. Fix amcheck's handling of half-dead B-tree pages

  2. Fix amcheck's handling of incomplete root splits in B-tree

  3. Add a test for half-dead pages in B-tree indexes

  4. Add a test for incomplete splits in B-tree indexes

  5. Improve checking of child pages in contrib/amcheck.

On 02/12/2025 19:59, Peter Geoghegan wrote:
> On Mon, Dec 1, 2025 at 4:20 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>> Summary of the patches:
>>
>> Patch 0001 adds an injection point test for incomplete splits. We
>> already had such a test for GIN, which handles incomplete splits the
>> same way as B-tree. I copy-pasted and adapted the GIN test for B-tree.
>> This was an easy way to increase our test coverage.
>>
>> Patch 0002 fixes the incomplete-root-split bug in amcheck. It modifies
>> the test added in patch 0001 to cover the bug fix.
>>
>> Patch 0003 adds a test for half-dead pages, similar to what 0001 did for
>> incomplete splits.
>>
>> Patch 0004 fixes the bogus half-deaf-page error in amcheck, i.e. the
>> issue that started this thread. It modifies the test introduced in patch
>> 0003 to add amcheck calls, to cover the bug fix.
> 
> All seem reasonable.
> 
> These tests will increase nbtree code coverage quite a bit, which is a
> nice bonus.

Committed, thanks for the review!

- Heikki