49 #define InvalidBtreeLevel ((uint32) InvalidBlockNumber) 50 #define BTreeTupleGetNKeyAtts(itup, rel) \ 51 Min(IndexRelationGetNumberOfKeyAttributes(rel), BTreeTupleGetNAtts(itup, rel)) 163 bool tupleIsAlive,
void *checkstate);
293 errmsg(
"could not open parent table of index %s",
307 (
errcode(ERRCODE_INDEX_CORRUPTED),
308 errmsg(
"index \"%s\" lacks a main relation fork",
313 if (allequalimage && !heapkeyspace)
315 (
errcode(ERRCODE_INDEX_CORRUPTED),
316 errmsg(
"index \"%s\" metapage has equalimage field set on unsupported nbtree version",
320 (
errcode(ERRCODE_INDEX_CORRUPTED),
321 errmsg(
"index \"%s\" metapage incorrectly indicates that deduplication is safe",
326 heapallindexed, rootdescend);
350 if (rel->
rd_rel->relkind != RELKIND_INDEX ||
351 rel->
rd_rel->relam != BTREE_AM_OID)
353 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
354 errmsg(
"only B-Tree indexes are supported as targets for verification"),
355 errdetail(
"Relation \"%s\" is not a B-Tree index.",
360 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
361 errmsg(
"cannot access temporary tables of other sessions"),
362 errdetail(
"Index \"%s\" is associated with temporary relation.",
367 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
368 errmsg(
"cannot check index \"%s\"",
383 if (rel->
rd_rel->relpersistence != RELPERSISTENCE_UNLOGGED ||
388 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
389 errmsg(
"cannot verify unlogged index \"%s\" during recovery, skipping",
430 elog(
DEBUG1,
"verifying consistency of tree structure for index \"%s\"",
433 elog(
DEBUG1,
"verifying consistency of tree structure for index \"%s\" with cross-level checks",
503 (
errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
504 errmsg(
"index \"%s\" cannot be verified using transaction snapshot",
512 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
513 errmsg(
"cannot verify that tuples from index \"%s\" can each be found by an independent index search",
515 errhint(
"Only B-Tree version 4 indexes support rootdescend verification.")));
538 errmsg(
"harmless fast root mismatch in index %s",
540 errdetail_internal(
"Fast root block %u (level %u) differs from true root block %u (level %u).",
563 (
errcode(ERRCODE_INDEX_CORRUPTED),
564 errmsg(
"index \"%s\" has no valid pages on level below %u or first level",
567 previouslevel = current.
level;
616 elog(
DEBUG1,
"verifying that tuples from index \"%s\" are present in \"%s\"",
678 " (true root level)" : level.
level == 0 ?
" (leaf level)" :
"");
710 (
errcode(ERRCODE_INDEX_CORRUPTED),
711 errmsg(
"downlink or sibling link points to deleted block in index \"%s\"",
714 current, leftcurrent, opaque->
btpo_prev)));
718 (
errcode(ERRCODE_INDEX_CORRUPTED),
719 errmsg(
"block %u fell off the end of index \"%s\"",
724 errmsg(
"block %u of index \"%s\" ignored",
741 (
errcode(ERRCODE_INDEX_CORRUPTED),
742 errmsg(
"block %u is not leftmost in index \"%s\"",
747 (
errcode(ERRCODE_INDEX_CORRUPTED),
748 errmsg(
"block %u is not true root in index \"%s\"",
800 (
errcode(ERRCODE_INDEX_CORRUPTED),
801 errmsg(
"leftmost down link for level points to block in index \"%s\" whose level is not one level down",
803 errdetail_internal(
"Block pointed to=%u expected level=%u level in pointed to block=%u.",
812 if (current == leftcurrent || current == opaque->
btpo_prev)
814 (
errcode(ERRCODE_INDEX_CORRUPTED),
815 errmsg(
"circular link chain found in block %u of index \"%s\"",
818 leftcurrent = current;
860 while (current !=
P_NONE);
872 return nextleveldown;
945 if (newtargetblock != leftcurrent)
955 btpo_prev_from_target = opaque->
btpo_prev;
977 if (btpo_prev_from_target == leftcurrent)
981 (
errcode(ERRCODE_INTERNAL_ERROR),
982 errmsg(
"harmless concurrent page split detected in index \"%s\"",
985 leftcurrent, newtargetblock,
1001 (
errcode(ERRCODE_INDEX_CORRUPTED),
1002 errmsg(
"left link/right link pair in index \"%s\" not in agreement",
1006 btpo_prev_from_target)));
1054 elog(
DEBUG2,
"verifying %u items on %s block %u", max,
1074 (
errcode(ERRCODE_INDEX_CORRUPTED),
1075 errmsg(
"wrong number of high key index tuple attributes in index \"%s\"",
1080 P_ISLEAF(topaque) ?
"heap" :
"index",
1099 bool lowersizelimit;
1117 (
errcode(ERRCODE_INDEX_CORRUPTED),
1118 errmsg(
"index tuple size does not equal lp_len in index \"%s\"",
1125 errhint(
"This could be a torn page problem.")));
1142 (
errcode(ERRCODE_INDEX_CORRUPTED),
1143 errmsg(
"wrong number of index tuple attributes in index \"%s\"",
1148 P_ISLEAF(topaque) ?
"heap" :
"index",
1193 (
errcode(ERRCODE_INDEX_CORRUPTED),
1194 errmsg(
"could not find tuple using search from root page in index \"%s\"",
1223 (
errcode(ERRCODE_INDEX_CORRUPTED),
1224 errmsg_internal(
"posting list contains misplaced TID in index \"%s\"",
1278 (
errcode(ERRCODE_INDEX_CORRUPTED),
1279 errmsg(
"index row size %zu exceeds maximum for index \"%s\"",
1283 P_ISLEAF(topaque) ?
"heap" :
"index",
1306 if (norm != logtuple)
1386 (
errcode(ERRCODE_INDEX_CORRUPTED),
1387 errmsg(
"high key invariant violated for index \"%s\"",
1391 P_ISLEAF(topaque) ?
"heap" :
"index",
1433 (
errcode(ERRCODE_INDEX_CORRUPTED),
1434 errmsg(
"item order invariant violated for index \"%s\"",
1437 "higher index tid=%s (points to %s tid=%s) " 1440 P_ISLEAF(topaque) ?
"heap" :
"index",
1443 P_ISLEAF(topaque) ?
"heap" :
"index",
1466 else if (offset == max)
1498 (
errcode(ERRCODE_INDEX_CORRUPTED),
1499 errmsg(
"cross page item order invariant violated for index \"%s\"",
1608 errmsg(
"level %u leftmost page of index \"%s\" was found deleted or half dead",
1610 errdetail_internal(
"Deleted page found when building scankey from right sibling.")));
1736 errmsg(
"%s block %u of index \"%s\" has no first data item",
1737 P_ISLEAF(opaque) ?
"leaf" :
"internal", targetnext,
1845 state->
target, target_downlinkoffnum);
1889 (
errcode(ERRCODE_INDEX_CORRUPTED),
1890 errmsg(
"can't traverse from downlink %u to downlink %u of index \"%s\"",
1895 if (blkno == downlink && loaded_child)
1896 page = loaded_child;
1905 (
errcode(ERRCODE_INDEX_CORRUPTED),
1906 errmsg(
"the first child of leftmost target page is not leftmost of its level in index \"%s\"",
1916 (
errcode(ERRCODE_INDEX_CORRUPTED),
1917 errmsg(
"block found while following rightlinks from child of index \"%s\" has invalid level",
1919 errdetail_internal(
"Block pointed to=%u expected level=%u level in pointed to block=%u.",
1920 blkno, target_level - 1, opaque->
btpo.
level)));
1925 (
errcode(ERRCODE_INDEX_CORRUPTED),
1926 errmsg(
"circular link chain found in block %u of index \"%s\"",
1929 if (blkno != downlink && !
P_IGNORE(opaque))
1973 if (blkno == downlink)
1976 pivotkey_offset = target_downlinkoffnum;
1991 (
errcode(ERRCODE_INDEX_CORRUPTED),
1992 errmsg(
"child high key is greater than rightmost pivot key on target level in index \"%s\"",
2001 state->
target, pivotkey_offset);
2022 (
errcode(ERRCODE_INDEX_CORRUPTED),
2023 errmsg(
"can't find left sibling high key in index \"%s\"",
2035 (
errcode(ERRCODE_INDEX_CORRUPTED),
2036 errmsg(
"mismatch between parent key and child high key in index \"%s\"",
2046 if (blkno == downlink)
2057 if (page != loaded_child)
2090 state->
target, downlinkoffnum);
2176 (
errcode(ERRCODE_INDEX_CORRUPTED),
2177 errmsg(
"downlink to deleted page found in index \"%s\"",
2185 offset <= maxoffset;
2218 (
errcode(ERRCODE_INDEX_CORRUPTED),
2219 errmsg(
"down-link lower bound invariant violated for index \"%s\"",
2290 errmsg(
"harmless interrupted page split detected in index %s",
2295 (
uint32) (pagelsn >> 32),
2312 (
errcode(ERRCODE_INDEX_CORRUPTED),
2313 errmsg(
"leaf index block lacks downlink in index \"%s\"",
2317 (
uint32) (pagelsn >> 32),
2321 elog(
DEBUG1,
"checking for interrupted multi-level deletion due to missing downlink in index \"%s\"",
2341 (
errcode(ERRCODE_INDEX_CORRUPTED),
2342 errmsg_internal(
"downlink points to block in index \"%s\" whose level is not one level down",
2344 errdetail_internal(
"Top parent/under check block=%u block pointed to=%u expected level=%u level in pointed to block=%u.",
2379 (
errcode(ERRCODE_INDEX_CORRUPTED),
2380 errmsg_internal(
"downlink to deleted leaf page found in index \"%s\"",
2382 errdetail_internal(
"Top parent/target block=%u leaf block=%u top parent/under check lsn=%X/%X.",
2384 (
uint32) (pagelsn >> 32),
2406 (
errcode(ERRCODE_INDEX_CORRUPTED),
2407 errmsg(
"internal index block lacks downlink in index \"%s\"",
2411 (
uint32) (pagelsn >> 32),
2472 bool *isnull,
bool tupleIsAlive,
void *checkstate)
2490 errmsg(
"heap tuple (%u,%u) from table \"%s\" lacks matching index tuple within index \"%s\"",
2496 ?
errhint(
"Retrying verification using the function bt_index_parent_check() might provide a more specific error.")
2545 bool formnewtup =
false;
2556 for (i = 0; i < tupleDescriptor->
natts; i++)
2563 toast_free[
i] =
false;
2567 if (att->attbyval || att->attlen != -1 || isnull[i])
2577 (
errcode(ERRCODE_INDEX_CORRUPTED),
2578 errmsg(
"external varlena datum in tuple that references heap row (%u,%u) in index \"%s\"",
2586 toast_free[
i] =
true;
2607 for (i = 0; i < tupleDescriptor->
natts; i++)
2690 insertstate.
itup = itup;
2695 insertstate.
buf = lbuf;
2804 if (key->
keysz == uppnkeyatts)
2805 return key->
scantid == NULL && rheaptid != NULL;
2807 return key->
keysz < uppnkeyatts;
2919 if (key->
keysz == uppnkeyatts)
2920 return key->
scantid == NULL && childheaptid != NULL;
2922 return key->
keysz < uppnkeyatts;
2974 (
errcode(ERRCODE_INDEX_CORRUPTED),
2975 errmsg(
"invalid meta page found at block %u in index \"%s\"",
2986 (
errcode(ERRCODE_INDEX_CORRUPTED),
2987 errmsg(
"index \"%s\" meta page is corrupt",
2993 (
errcode(ERRCODE_INDEX_CORRUPTED),
2994 errmsg(
"version mismatch in index \"%s\": file version %d, " 2995 "current version %d, minimum supported version %d",
3010 (
errcode(ERRCODE_INDEX_CORRUPTED),
3011 errmsg(
"invalid leaf page level %u for block %u in index \"%s\"",
3017 (
errcode(ERRCODE_INDEX_CORRUPTED),
3018 errmsg(
"invalid internal page level 0 for block %u in index \"%s\"",
3043 (
errcode(ERRCODE_INDEX_CORRUPTED),
3044 errmsg(
"Number of items on block %u of index \"%s\" exceeds MaxIndexTuplesPerPage (%u)",
3050 (
errcode(ERRCODE_INDEX_CORRUPTED),
3051 errmsg(
"internal block %u in index \"%s\" lacks high key and/or at least one downlink",
3056 (
errcode(ERRCODE_INDEX_CORRUPTED),
3057 errmsg(
"non-rightmost leaf block %u in index \"%s\" lacks high key item",
3071 (
errcode(ERRCODE_INDEX_CORRUPTED),
3072 errmsg(
"internal page block %u in index \"%s\" is half-dead",
3074 errhint(
"This can be caused by an interrupted VACUUM in version 9.3 or older, before upgrade. Please REINDEX it.")));
3078 (
errcode(ERRCODE_INDEX_CORRUPTED),
3079 errmsg(
"internal page block %u in index \"%s\" has garbage items",
3132 (
errcode(ERRCODE_INDEX_CORRUPTED),
3133 errmsg(
"line pointer points past end of tuple space in index \"%s\"",
3148 (
errcode(ERRCODE_INDEX_CORRUPTED),
3149 errmsg(
"invalid line pointer storage in index \"%s\"",
3177 (
errcode(ERRCODE_INDEX_CORRUPTED),
3178 errmsg_internal(
"block %u or its right sibling block or child block in index \"%s\" has unexpected pivot tuple",
3184 (
errcode(ERRCODE_INDEX_CORRUPTED),
3185 errmsg_internal(
"block %u or its right sibling block or child block in index \"%s\" has unexpected non-pivot tuple",
3192 (
errcode(ERRCODE_INDEX_CORRUPTED),
3193 errmsg(
"block %u or its right sibling block or child block in index \"%s\" contains non-pivot tuple that lacks a heap TID",
3224 return &itup->
t_tid;
BufferAccessStrategy GetAccessStrategy(BufferAccessStrategyType btype)
int32 ItemPointerCompare(ItemPointer arg1, ItemPointer arg2)
#define ItemPointerIsValid(pointer)
#define ItemPointerGetOffsetNumberNoCheck(pointer)
bloom_filter * bloom_create(int64 total_elems, int bloom_work_mem, uint64 seed)
Oid IndexGetRelation(Oid indexId, bool missing_ok)
#define VARATT_IS_COMPRESSED(PTR)
static bool invariant_leq_offset(BtreeCheckState *state, BTScanInsert key, OffsetNumber upperbound)
static ItemPointer BTreeTupleGetPointsToTID(IndexTuple itup)
void _bt_freestack(BTStack stack)
IndexTuple _bt_form_posting(IndexTuple base, ItemPointer htids, int nhtids)
static bool btree_index_mainfork_expected(Relation rel)
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
void table_close(Relation relation, LOCKMODE lockmode)
int errhint(const char *fmt,...)
#define ERRCODE_UNDEFINED_TABLE
Datum bt_index_parent_check(PG_FUNCTION_ARGS)
static void btree_index_checkable(Relation rel)
#define ItemIdIsRedirected(itemId)
static bool BTreeTupleIsPivot(IndexTuple itup)
static BtreeLevel bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
Snapshot RegisterSnapshot(Snapshot snapshot)
static ItemPointer BTreeTupleGetHeapTID(IndexTuple itup)
#define RelationGetDescr(relation)
BTScanInsert _bt_mkscankey(Relation rel, IndexTuple itup)
static Page palloc_btree_page(BtreeCheckState *state, BlockNumber blocknum)
#define PointerGetDatum(X)
void bloom_add_element(bloom_filter *filter, unsigned char *elem, size_t len)
#define TupleDescAttr(tupdesc, i)
struct SMgrRelationData * rd_smgr
static void bt_tuple_present_callback(Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *checkstate)
char * psprintf(const char *fmt,...)
#define P_FIRSTDATAKEY(opaque)
Buffer ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy)
static IndexTuple bt_normalize_tuple(BtreeCheckState *state, IndexTuple itup)
union BTPageOpaqueData::@46 btpo
static bool bt_pivot_tuple_identical(bool heapkeyspace, IndexTuple itup1, IndexTuple itup2)
#define ItemIdIsUsed(itemId)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
#define IsolationUsesXactSnapshot()
static BlockNumber BTreeTupleGetDownLink(IndexTuple pivot)
#define BTMaxItemSizeNoHeapTid(page)
#define P_HAS_GARBAGE(opaque)
int errcode(int sqlerrcode)
void MemoryContextReset(MemoryContext context)
static BTScanInsert bt_right_page_check_scankey(BtreeCheckState *state)
#define P_INCOMPLETE_SPLIT(opaque)
#define PG_GETARG_BOOL(n)
IndexInfo * BuildIndexInfo(Relation index)
bool smgrexists(SMgrRelation reln, ForkNumber forknum)
#define MaxTIDsPerBTreePage
bool RecoveryInProgress(void)
#define ItemIdIsDead(itemId)
#define BTreeTupleGetNAtts(itup, rel)
BufferAccessStrategy checkstrategy
Snapshot GetTransactionSnapshot(void)
#define OidIsValid(objectId)
#define PageGetMaxOffsetNumber(page)
BTPageOpaqueData * BTPageOpaque
static void bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit, BlockNumber targetblock, Page target)
static TableScanDesc table_beginscan_strat(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key, bool allow_strat, bool allow_sync)
int errdetail_internal(const char *fmt,...)
struct HeapTupleData * rd_indextuple
static bool invariant_l_offset(BtreeCheckState *state, BTScanInsert key, OffsetNumber upperbound)
static void bt_index_check_internal(Oid indrelid, bool parentcheck, bool heapallindexed, bool rootdescend)
static bool invariant_g_offset(BtreeCheckState *state, BTScanInsert key, OffsetNumber lowerbound)
#define RelationOpenSmgr(relation)
#define VARATT_IS_EXTERNAL(PTR)
IndexTuple index_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
#define ItemIdGetLength(itemId)
void pfree(void *pointer)
void _bt_checkpage(Relation rel, Buffer buf)
#define P_ISHALFDEAD(opaque)
void UnlockReleaseBuffer(Buffer buffer)
static double table_index_build_scan(Relation table_rel, Relation index_rel, struct IndexInfo *index_info, bool allow_sync, bool progress, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
#define ALLOCSET_DEFAULT_SIZES
static void bt_recheck_sibling_links(BtreeCheckState *state, BlockNumber btpo_prev_from_target, BlockNumber leftcurrent)
Datum bt_index_check(PG_FUNCTION_ARGS)
static void bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace, bool readonly, bool heapallindexed, bool rootdescend)
OffsetNumber _bt_binsrch_insert(Relation rel, BTInsertState insertstate)
IndexTupleData * IndexTuple
int errdetail(const char *fmt,...)
#define RelationGetRelationName(relation)
#define P_LEFTMOST(opaque)
FormData_pg_attribute * Form_pg_attribute
#define ItemIdGetOffset(itemId)
MemoryContext CurrentMemoryContext
int32 _bt_compare(Relation rel, BTScanInsert key, Page page, OffsetNumber offnum)
#define BufferGetPage(buffer)
static ItemPointer BTreeTupleGetHeapTIDCareful(BtreeCheckState *state, IndexTuple itup, bool nonpivot)
#define P_ISDELETED(opaque)
bool TransactionIdPrecedes(TransactionId id1, TransactionId id2)
void _bt_metaversion(Relation rel, bool *heapkeyspace, bool *allequalimage)
void UnregisterSnapshot(Snapshot snapshot)
#define ERRCODE_DATA_CORRUPTED
void bloom_free(bloom_filter *filter)
#define PageGetItemId(page, offsetNumber)
static ItemPointer BTreeTupleGetMaxHeapTID(IndexTuple itup)
static bool invariant_l_nontarget_offset(BtreeCheckState *state, BTScanInsert key, BlockNumber nontargetblock, Page nontarget, OffsetNumber upperbound)
#define ItemIdGetFlags(itemId)
void * palloc0(Size size)
static BTScanInsert bt_mkscankey_pivotsearch(Relation rel, IndexTuple itup)
void LockBuffer(Buffer buffer, int mode)
#define RelationGetNumberOfBlocks(reln)
#define BTREE_MIN_VERSION
#define InvalidOffsetNumber
void _bt_relbuf(Relation rel, Buffer buf)
#define ereport(elevel,...)
#define BlockNumberIsValid(blockNumber)
static ItemPointer BTreeTupleGetPostingN(IndexTuple posting, int n)
static bool BTreeTupleIsPosting(IndexTuple itup)
int errmsg_internal(const char *fmt,...)
bool _bt_check_natts(Relation rel, bool heapkeyspace, Page page, OffsetNumber offnum)
static void bt_child_highkey_check(BtreeCheckState *state, OffsetNumber target_downlinkoffnum, Page loaded_child, uint32 target_level)
#define Assert(condition)
#define RELATION_IS_OTHER_TEMP(relation)
#define BTreeTupleGetNKeyAtts(itup, rel)
static void bt_target_page_check(BtreeCheckState *state)
struct BtreeLevel BtreeLevel
#define HeapTupleHeaderGetXmin(tup)
#define OffsetNumberNext(offsetNumber)
#define PageGetSpecialPointer(page)
#define InvalidBlockNumber
#define BufferIsValid(bufnum)
#define index_getattr(tup, attnum, tupleDesc, isnull)
#define ItemPointerGetOffsetNumber(pointer)
#define IndexTupleHasVarwidths(itup)
double bloom_prop_bits_set(bloom_filter *filter)
static void bt_child_check(BtreeCheckState *state, BTScanInsert targetkey, OffsetNumber downlinkoffnum)
void index_close(Relation relation, LOCKMODE lockmode)
#define DatumGetPointer(X)
#define BTMaxItemSize(page)
static bool bt_rootdescend(BtreeCheckState *state, IndexTuple itup)
static Datum values[MAXATTR]
#define MaxIndexTuplesPerPage
int errmsg(const char *fmt,...)
static ItemId PageGetItemIdCareful(BtreeCheckState *state, BlockNumber block, Page page, OffsetNumber offset)
#define ItemPointerGetBlockNumberNoCheck(pointer)
void * MemoryContextAlloc(MemoryContext context, Size size)
#define OffsetNumberIsValid(offsetNumber)
static BlockNumber BTreeTupleGetTopParent(IndexTuple leafhikey)
static uint16 BTreeTupleGetNPosting(IndexTuple posting)
#define PG_DETOAST_DATUM(datum)
static bool offset_is_negative_infinity(BTPageOpaque opaque, OffsetNumber offset)
#define CHECK_FOR_INTERRUPTS()
#define ItemPointerGetBlockNumber(pointer)
#define InvalidBtreeLevel
#define TransactionIdIsValid(xid)
PG_FUNCTION_INFO_V1(bt_index_check)
uint16 * ii_ExclusionStrats
Relation table_open(Oid relationId, LOCKMODE lockmode)
bool _bt_allequalimage(Relation rel, bool debugmessage)
MemoryContext targetcontext
#define P_RIGHTMOST(opaque)
BlockNumber prevrightlink
Relation index_open(Oid relationId, LOCKMODE lockmode)
BTStack _bt_search(Relation rel, BTScanInsert key, Buffer *bufP, int access, Snapshot snapshot)
#define offsetof(type, field)
bool bloom_lacks_element(bloom_filter *filter, unsigned char *elem, size_t len)
#define PageGetItem(page, itemId)
#define IndexTupleSize(itup)
#define ItemPointerCopy(fromPointer, toPointer)
static int cmp(const chr *x, const chr *y, size_t len)
static IndexTuple bt_posting_plain_tuple(IndexTuple itup, int n)
struct BtreeCheckState BtreeCheckState