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

Commit f2a6df9

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 4d288e3 commit f2a6df9

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

789-
if (level.istruerootlevel && !P_ISROOT(opaque))
789+
if (level.istruerootlevel && (!P_ISROOT(opaque) && !P_INCOMPLETE_SPLIT(opaque)))
790790
ereport(ERROR,
791791
(errcode(ERRCODE_INDEX_CORRUPTED),
792792
errmsg("block %u is not true root in index \"%s\"",

0 commit comments

Comments
 (0)