On Tue, Nov 25, 2025 at 3:03 PM Heikki Linnakangas <[email protected]> wrote: > To fix this, I guess we need to teach bt_index_parent_check() about > half-dead pages. Anyone volunteer to write that patch?
It's not like bt_index_parent_check doesn't generally know about them. For example, bt_downlink_missing_check goes to great lengths to distinguish between legitimate "missing" downlinks caused by an interrupted page deletion, and real missing downlinks caused by corruption. The problem we're seeing here seems likely limited to code added by commit d114cc53, which enhanced bt_index_parent_check by adding the new bt_child_highkey_check check. bt_child_highkey_check actually reuses bt_downlink_missing_check (which deals with half-dead pages correctly), but still isn't careful enough about half-dead pages. This is kind of surprising, since it *does* account for incomplete splits, which are similar. In short, I think that we need to track something like BtreeCheckState.previncompletesplit, but for half-dead pages. And then actually use that within bt_child_highkey_check, to avoid spurious false-positive reports of corruption. -- Peter Geoghegan
