public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Geoghegan <[email protected]>
To: Michail Nikolaev <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: bt_index_parent_check and concurrently build indexes
Date: Fri, 13 Dec 2024 17:26:22 -0500
Message-ID: <CAH2-WzmcFDK2OzziTgdHxPTmaRQmSFLoDjS-C06uWGTsXibx9g@mail.gmail.com> (raw)
In-Reply-To: <CANtu0ojmVd27fEhfpST7RG2KZvwkX=dMyKUqg0KM87FkOSdz8Q@mail.gmail.com>
References: <CANtu0ojmVd27fEhfpST7RG2KZvwkX=dMyKUqg0KM87FkOSdz8Q@mail.gmail.com>

On Mon, Dec 9, 2024 at 3:51 PM Michail Nikolaev
<[email protected]> wrote:
> After some time, I managed to find a way to reproduce the issue. It turns out that bt_index_parent_check is not suitable for validating indexes built concurrently.

Good catch.

> I’ve attached a patch that reproduces the issue (it incorrectly reports the index as invalid, even though it is actually valid).
>
> I’m unsure of the best way to address this issue, but here are some possible options:
> * Simply update the documentation.
> * Issue a WARNING if !tupleIsAlive.
> * Modify bt_index_parent_check to use an MVCC snapshot for the heap scan

Offhand, I think that using an MVCC snapshot would make the most sense.

It's not as if there is a big benefit to not doing so with
bt_index_parent_check. My recollection is that we did it this way
because it was as close as possible to the CREATE INDEX code that
heapallindexed verification was loosely based on.

-- 
Peter Geoghegan






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: bt_index_parent_check and concurrently build indexes
  In-Reply-To: <CAH2-WzmcFDK2OzziTgdHxPTmaRQmSFLoDjS-C06uWGTsXibx9g@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox