🌐 AI搜索 & 代理 主页
Skip to content

Commit 5a2d1df

Browse files
committed
Fix amcheck's handling of incomplete root splits in B-tree
When the root page is being split, it's normal that root page according to the metapage is not marked BTP_ROOT. Fix bogus error in amcheck about that case. Reviewed-by: Peter Geoghegan <pg@bowt.ie> Discussion: https://www.postgresql.org/message-id/abd65090-5336-42cc-b768-2bdd66738404@iki.fi Backpatch-through: 14
1 parent c090965 commit 5a2d1df

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
@@ -847,7 +847,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
847847
errmsg("block %u is not leftmost in index \"%s\"",
848848
current, RelationGetRelationName(state->rel))));
849849

850-
if (level.istruerootlevel && !P_ISROOT(opaque))
850+
if (level.istruerootlevel && (!P_ISROOT(opaque) && !P_INCOMPLETE_SPLIT(opaque)))
851851
ereport(ERROR,
852852
(errcode(ERRCODE_INDEX_CORRUPTED),
853853
errmsg("block %u is not true root in index \"%s\"",

0 commit comments

Comments
 (0)