postgresql/contrib/amcheck
Álvaro Herrera 098a1fab8a
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 6bd469d26a to branches 14-16.  I previously misidentified
the bug's origin: it came in with commit 7f563c09f8 (pg11-era, not
5ae2087202 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
2026-01-21 18:55:43 +01:00
..
expected amcheck: Normalize index tuples containing uncompressed varlena 2024-03-23 23:02:30 +02:00
sql amcheck: Normalize index tuples containing uncompressed varlena 2024-03-23 23:02:30 +02:00
t amcheck: Fix snapshot usage in bt_index_parent_check 2026-01-21 18:55:43 +01:00
.gitignore Add .gitignore to contrib/amcheck. 2017-03-09 22:45:24 -05:00
amcheck--1.0--1.1.sql Add amcheck verification of heap relations belonging to btree indexes. 2018-03-31 19:52:01 -07:00
amcheck--1.0.sql Add amcheck extension to contrib. 2017-03-09 16:33:02 -08:00
amcheck--1.1--1.2.sql Allow amcheck to re-find tuples using new search. 2019-03-20 10:41:36 -07:00
amcheck--1.2--1.3.sql Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
amcheck.control Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
Makefile amcheck: Distinguish interrupted page deletion from corruption. 2023-10-30 14:46:08 -07:00
meson.build amcheck: Distinguish interrupted page deletion from corruption. 2023-10-30 14:46:08 -07:00
verify_heapam.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
verify_nbtree.c amcheck: Fix snapshot usage in bt_index_parent_check 2026-01-21 18:55:43 +01:00