Re: Corrupted btree index on HEAD because of covering indexes

Alexander Korotkov <a.korotkov@postgrespro.ru>

From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Teodor Sigaev <teodor@sigaev.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-19T21:00:11Z
Lists: pgsql-hackers
On Thu, Apr 19, 2018 at 10:47 PM, Teodor Sigaev <teodor@sigaev.ru> wrote:

> I also think that we could have better conventional regression test
>> coverage here.
>>
>
> I tried to minimize Michael's test case and add it to patch.


- if (ItemPointerIsValid(leafhikey))
+ if (ItemPointerGetBlockNumberNoCheck(leafhikey) != InvalidBlockNumber)

Should we use BTreeInnerTupleGetDownLink() as soon as we use
BTreeInnerTupleSetDownLink() for setting this?
Or even invent BTreeInnerTupleDownLinkIsValid() macro?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Add missing and dangling downlink checks to amcheck

  2. Fix wrong validation of top-parent pointer during page deletion in Btree.

  3. Add integrity-checking functions to pg_visibility.

  4. Make the handling of interrupted B-tree page splits more robust.