Re: Corrupted btree index on HEAD because of covering indexes
Teodor Sigaev <teodor@sigaev.ru>
From: Teodor Sigaev <teodor@sigaev.ru>
To: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Peter Geoghegan <pg@bowt.ie>, Michael Paquier <michael@paquier.xyz>,
Postgres hackers <pgsql-hackers@postgresql.org>,
Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Date: 2018-04-20T14:18:12Z
Lists: pgsql-hackers
Attachments
- vacuum_nbtree-v3.patch (text/x-patch) patch v3
>> Should we use BTreeInnerTupleGetDownLink() as soon as we use
>> BTreeInnerTupleSetDownLink() for setting this?
>> Or even invent BTreeInnerTupleDownLinkIsValid() macro?
> I am not sure. Here we actually store UP link - to top parent to remove. I'm
> afraid using BTreeInnerTupleGetDownLink/BTreeInnerTupleSetDownLink could cause a
> confusion, in other hand, introducing
> TreeInnerTupleGetUpLink/BTreeInnerTupleSetUpLink seems over-engineering
>
After close look I change my opinion. To have a clean code it's much better to
have new pair get/set macroses specialy to manage link to top pare during page
deletion. This removes last naked usage of
ItemPointer(SetInvalid/IsInvalid/GetBlockNumberNoCheck) and uses self-described
macroses. Patch is attached.
--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/
Commits
-
Add missing and dangling downlink checks to amcheck
- 4eaf7eaccb29 11.0 landed
-
Fix wrong validation of top-parent pointer during page deletion in Btree.
- 6db4b49986be 11.0 landed
-
Add integrity-checking functions to pg_visibility.
- e472ce9624e0 9.6.0 cited
-
Make the handling of interrupted B-tree page splits more robust.
- 40dae7ec537c 9.4.0 cited