Re: Corrupted btree index on HEAD because of covering indexes

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Michael Paquier <michael(at)paquier(dot)xyz>, Postgres hackers <pgsql-hackers(at)postgresql(dot)org>, Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>
Subject: Re: Corrupted btree index on HEAD because of covering indexes
Date: 2018-04-20 14:18:12
Message-ID: 24ac23bf-bf00-229c-8ef3-f60542cab627@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> 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(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

Attachment Content-Type Size
vacuum_nbtree-v3.patch text/x-patch 6.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-04-20 15:32:07 Re: [HACKERS] proposal: schema variables
Previous Message Michael Paquier 2018-04-20 13:58:06 Re: SHOW ALL does not honor pg_read_all_settings membership