Re: BTP_DELETED leaf still in tree

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Daniel Wood <hexexpert(at)comcast(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BTP_DELETED leaf still in tree
Date: 2019-10-10 20:26:18
Message-ID: CAH2-Wzm5zLpOSKWHEXbOatTHC=b0vuPBY78u5xfDUZ_BNnuQ+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 10, 2019 at 1:18 PM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> You didn't say which PostgreSQL versions were involved, and if the
> database was ever upgraded using pg_upgrade. Those details could
> matter.

In case you weren't aware, contrib/amcheck should make detected and
diagnosing these kinds of problems a lot easier. You should prefer to
use the bt_index_parent_check() variant (which will block writes and
VACUUM, but not reads). It will verify that sibling pointers are in
agreement with each other, and that leaf pages contain keys that are
covered by the relevant separator keys from the parent level.

If you happen to be using v11, then you might also want to use the
heapallindexed option -- that will verify that the heap and index are
in agreement. If the issue is on v12, the new "rootdescend" option can
detect very subtle cross-level transitive consistency options. (This
is only available in v12 because that was the version that made all
entries in the index unique by using heap TID as a unique-ifier.)

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2019-10-10 20:40:22 Re: BUG #16045: vacuum_db crash and illegal memory alloc after pg_upgrade from PG11 to PG12
Previous Message Peter Geoghegan 2019-10-10 20:18:16 Re: BTP_DELETED leaf still in tree