pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: amcheck: Fix snapshot usage in bt_index_parent_check
Date: Thu, 04 Dec 2025 17:12:57 +0000
Message-ID: <E1vRCsy-002nI1-2t@gemulon.postgresql.org> (raw)

amcheck: Fix snapshot usage in bt_index_parent_check

We were using SnapshotAny to do some index checks, but that's wrong and
causes spurious errors when used on indexes created by CREATE INDEX
CONCURRENTLY.  Fix it to use an MVCC snapshot, and add a test for it.

This problem came in with commit 5ae2087202af, which introduced
uniqueness check.  Backpatch to 17.

Author: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Backpatch-through: 17
Discussion: https://postgr.es/m/CANtu0ojmVd27fEhfpST7RG2KZvwkX=dMyKUqg0KM87FkOSdz8Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6bd469d26aca6ea413b35bfcb611dfa3a8f5ea45

Modified Files
--------------
contrib/amcheck/t/002_cic.pl    | 23 +++++++++++
contrib/amcheck/verify_nbtree.c | 86 +++++++++++++++++------------------------
doc/src/sgml/amcheck.sgml       |  2 +-
3 files changed, 60 insertions(+), 51 deletions(-)



view thread (9+ messages)  latest in thread

Message-ID: <E1vRCsy-002nI1-2t@gemulon.postgresql.org>
Permalink:  ../E1vRCsy-002nI1-2t@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vRCsy-002nI1-2t@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: amcheck: Fix snapshot usage in bt_index_parent_check
  In-Reply-To: <E1vRCsy-002nI1-2t@gemulon.postgresql.org>

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

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