Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tidb的业务表,自增主键达到万亿(6666675293967 )级别的时候,使用tiflash的问题

[TiDB Usage Environment] Production Environment
[TiDB Version] 7.2
[Reproduction Path]
[Encountered Problem: Problem Phenomenon and Impact] In the production system, the auto-increment primary key of this business table has reached 6 trillion rows, and it is found that the synchronization from tikv to tiflash often crashes.
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]
show create table event_analyze \G;
*************************** 1. row ***************************
Table: event_analyze
Create Table: CREATE TABLE event_analyze
(
id
bigint(20) NOT NULL AUTO_INCREMENT,
title
varchar(255) DEFAULT NULL COMMENT ‘Title’,
KEY province_index
(province
),
KEY number_index
(number
),
KEY commandId_index
(commandId
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=6666675293967 COMMENT=‘Event Analysis Main Table’
1 row in set (0.00 sec)
Error as follows
[2023/08/30 09:55:19.453 +08:00] [ERROR] [Exception.cpp:90] ["Code: 49, e.displayText() = DB::Exception: Check compare(range.getEnd(), ext_file.range.getEnd()) >= 0 failed, range.toDebugString() = [6666664934914,6666664941665), ext_file.range.toDebugString() = [6666664934914,6666664941666), e.what() = DB::Exception, Stack trace:\n\n\n 0x1bfe42e\tDB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int) [tiflash+29353006]\n \tdbms/src/Common/Exception.h:46\n 0x73a0bde\tDB::DM::DeltaMergeStore::ingestFiles(std::__1::shared_ptrDB::DM::DMContext const&, DB::DM::RowKeyRange const&, std::__1::vector<DB::DM::ExternalDTFileInfo, std::__1::allocatorDB::DM::ExternalDTFileInfo > const&, bool) [tiflash+121244638]\n \tdbms/src/Storages/DeltaMerge/DeltaMergeStore_Ingest.cpp:564\n 0x7e63fe4\tDB::DM::DeltaMergeStore::ingestFiles(DB::Context const&, DB::Settings const&, DB::DM::RowKeyRange const&, std::__1::vector<DB::DM::ExternalDTFileInfo, std::_1::allocatorDB::DM::ExternalDTFileInfo > const&, bool) [tiflash+132530148]\n \tdbms/src/Storages/DeltaMerge/DeltaMergeStore.h:305\n 0x7f119d9\tvoid DB::KVStore::checkAndApplyPreHandledSnapshotDB::RegionPtrWithSnapshotFiles(DB::RegionPtrWithSnapshotFiles const&, DB::TMTContext&) [tiflash+133241305]\n \tdbms/src/Storages/Transaction/ApplySnapshot.cpp:139\n 0x7f10166\tvoid DB::KVStore::applyPreHandledSnapshotDB::RegionPtrWithSnapshotFiles(DB::RegionPtrWithSnapshotFiles const&, DB::TMTContext&) [tiflash+133235046]\n \tdbms/src/Storages/Transaction/ApplySnapshot.cpp:426\n 0x7f87eb1\tApplyPreHandledSnapshot [tiflash+133725873]\n \tdbms/src/Storages/Transaction/ProxyFFI.cpp:664\n 0x7f3d2289a09f\t$LT$engine_store_ffi…observer…TiFlashObserver$LT$T$C$ER$GT$$u20$as$u20$raftstore…coprocessor…ApplySnapshotObserver$GT$::post_apply_snapshot::h9cf73b076a6be5ca [libtiflash_proxy.so+24293535]\n 0x7