pgsql: amcheck: Fix snapshot usage in bt_index_parent_check - Mailing list pgsql-committers

From Álvaro Herrera
Subject pgsql: amcheck: Fix snapshot usage in bt_index_parent_check
Date
Msg-id E1vicRl-001qB2-2N@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Backpatch of 6bd469d26aca to branches 14-16.  I previously misidentified
the bug's origin: it came in with commit 7f563c09f890 (pg11-era, not
5ae2087202af as claimed previously), so all live branches are affected.

Also take the opportunity to fix some comments that we failed to update
in the original commits and apply pgperltidy.  In branch 14, remove the
unnecessary test plan specification (which would have need to have been
changed anyway; c.f. commit 549ec201d613.)

Diagnosed-by: Donghang Lin <donghanglin@gmail.com>
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
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/098a1fab8a9bfe2b37eda8d790efbc15c9bdf7bc

Modified Files
--------------
contrib/amcheck/t/002_cic.pl    | 24 ++++++++++++++
contrib/amcheck/verify_nbtree.c | 69 ++++++++++++++++++-----------------------
doc/src/sgml/amcheck.sgml       |  2 +-
3 files changed, 56 insertions(+), 39 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Remove more leftovers of AIX support
Next
From: Tom Lane
Date:
Subject: pgsql: Remove useless flag PVC_INCLUDE_CONVERTROWTYPES.