| From: | Fujii Masao <fujii(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: amcheck: Fix missing allequalimage corruption report |
| Date: | 2026-06-12 00:40:16 |
| Message-ID: | E1wXpwW-00258Z-1B@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
amcheck: Fix missing allequalimage corruption report
When amcheck validates that a B-Tree metapage's allequalimage flag
matches _bt_allequalimage(), it could fail to report corruption
unless one of the index key columns used interval_ops. As a result,
pg_amcheck could silently miss this corruption on other opclasses,
incorrectly reporting the index as valid.
The mistake was that bt_index_check_callback() kept ereport(ERROR)
inside the loop that scans key attributes for INTERVAL_BTREE_FAM_OID,
even though that loop is only needed to decide whether to add
the interval-specific hint. This commit moves ereport() out of the loop
so allequalimage mismatches are always reported, while still emitting
the hint for affected interval indexes.
Back-patch to v18, where d70b17636dd introduced this regression
while moving the check into bt_index_check_callback().
Author: Chao Li <lic(at)highgo(dot)com>
Reviewed-by: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Reviewed-by: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Discussion: https://postgr.es/m/011ACC9C-CB87-4160-ACE7-4ED57AB86E15@gmail.com
Backpatch-through: 18
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/389bd4c5b93426e6616a0be7cff9cf91179c16e7
Modified Files
--------------
contrib/amcheck/verify_nbtree.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Fujii Masao | 2026-06-12 00:40:31 | pgsql: amcheck: Fix missing allequalimage corruption report |
| Previous Message | Fujii Masao | 2026-06-11 23:33:57 | pgsql: Fix md5_password_warnings for role and database settings |