Re: Improve search for missing parent downlinks in amcheck
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-04-28T00:03:39Z
Lists: pgsql-hackers
On Sat, Apr 27, 2019 at 4:57 PM Alexander Korotkov <a.korotkov@postgrespro.ru> wrote: > "rootdescend" is cool type of check. Thank you for noticing, I wasn't aware of it. > But can it detect the missing downlink in following situation? > > A > / \ > B <-> C <-> D > > Here A has downlinks to B and D, which downlink to C is missing, > while B, C and D are correctly connected with leftlinks and rightlinks. > I can see "rootdescend" calls _bt_search(), which would just step > right from C to D as if it was concurrent split. There is a comment about this scenario above bt_rootdescend() in amcheck. You're right -- this is a kind of corruption that even the new rootdescend verification option would miss. We can imagine a version of rootdescend verification that tells the core code to only move right when there was an *interrupted* page split (i.e. P_INCOMPLETE_SPLIT() flag bit is set), but that isn't what happens right now. That said, the lossy downlink check that you want to improve on *should* already catch this situation. Of course it might not because it is lossy (uses a Bloom filter), but I think that that's very unlikely. That's why I would like to understand the problem that you found with the check. -- Peter Geoghegan
Commits
-
Improve checking of child pages in contrib/amcheck.
- d114cc538715 13.0 landed
-
Don't rely on estimates for amcheck Bloom filters.
- 894af78f185a 13.0 landed
- 980224b4a230 12.0 landed
- 577c8802d350 11.5 landed