Skip to content

Commit fbb4b60

Browse files
committed
Fix amcheck's handling of half-dead B-tree pages
amcheck incorrectly reported the following error if there were any half-dead pages in the index: ERROR: mismatch between parent key and child high key in index "amchecktest_id_idx" It's expected that a half-dead page does not have a downlink in the parent level, so skip the test. Reported-by: Konstantin Knizhnik <knizhnik@garret.ru> Reviewed-by: Peter Geoghegan <pg@bowt.ie> Reviewed-by: Mihail Nikalayeu <mihailnikalayeu@gmail.com> Discussion: https://www.postgresql.org/message-id/33e39552-6a2a-46f3-8b34-3f9f8004451f@garret.ru Backpatch-through: 14
1 parent a4cb21e commit fbb4b60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/amcheck/verify_nbtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ bt_child_highkey_check(BtreeCheckState *state,
20472047
* If we visit page with high key, check that it is equal to the
20482048
* target key next to corresponding downlink.
20492049
*/
2050-
if (!rightsplit && !P_RIGHTMOST(opaque))
2050+
if (!rightsplit && !P_RIGHTMOST(opaque) && !P_ISHALFDEAD(opaque))
20512051
{
20522052
BTPageOpaque topaque;
20532053
IndexTuple highkey;

0 commit comments

Comments
 (0)