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 <[email protected]>
Reviewed-by: Andrey Borodin <[email protected]>
Backpatch-through: 17
Discussion: 
https://postgr.es/m/CANtu0ojmVd27fEhfpST7RG2KZvwkX=dmykuqg0km87fkosd...@mail.gmail.com

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/df93f94dda51cae1d81526472e41bbde0a089377

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(-)

Reply via email to