pgsql: Fix amcheck for page checks concurrent to replay of btree page d - Mailing list pgsql-committers

From Alexander Korotkov
Subject pgsql: Fix amcheck for page checks concurrent to replay of btree page d
Date
Msg-id E1jZAaW-00026r-7c@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix amcheck for page checks concurrent to replay of btree page deletion

amcheck expects at least hikey to always exist on leaf page even if it is
deleted page.  But replica reinitializes page during replay of page deletion,
causing deleted page to have no items.  Thus, replay of page deletion can
cause an error in concurrent amcheck run.

This commit relaxes amcheck expectation making it tolerate deleted page with
no items.

Reported-by: Konstantin Knizhnik
Discussion: https://postgr.es/m/CAPpHfdt_OTyQpXaPJcWzV2N-LNeNJseNB-K_A66qG%3DL518VTFw%40mail.gmail.com
Author: Alexander Korotkov
Reviewed-by: Peter Geoghegan
Backpatch-through: 11

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/34dae902ca1c7d32a24b711131911e3045c0097d

Modified Files
--------------
contrib/amcheck/verify_nbtree.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Move check for fsync=off so that pendingOps still gets cleared.
Next
From: Alexander Korotkov
Date:
Subject: pgsql: Fix amcheck for page checks concurrent to replay of btree page d