Re: bt_index_parent_check and concurrently build indexes

From: Donghang Lin <donghanglin(at)gmail(dot)com>
To: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
Cc: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bt_index_parent_check and concurrently build indexes
Date: 2025-06-03 00:40:18
Message-ID: CAA=D8a2Q23miHJtHRDk_TSQKvd6oHk8wGpkQt99B=9yd-oqnfg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Michail

> It turns out that bt_index_parent_check is not suitable for
validating indexes built concurrently.
Your finding is right on point! We recently used bt_index_parent_check to
verify concurrently built indexes in a concurrent workload,
bt_index_parent_check often gave such false positive error.

- indexinfo->ii_Concurrent = !state->readonly;
+ indexinfo->ii_Concurrent = true;

One suggestion to this change is that we might need to update the amcheck
doc to reflect that
"This consists of a “dummy” CREATE INDEX CONCURRENTLY operation" rather
than "CREATE INDEX" operation.

Regards,
Donghang

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-06-03 01:05:55 Re: Add “FOR UPDATE NOWAIT” lock details to the log.
Previous Message Jeff Davis 2025-06-03 00:23:44 Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them