tidb的业务表,自增主键达到万亿(6666675293967 )级别的时候,使用tiflash的问题

【 TiDB 使用环境】生产环境
【 TiDB 版本】7.2
【复现路径】
【遇到的问题:问题现象及影响】生产系统中,这个业务表的自增主键达到6万亿条,发现tikv->tiflash同步经常挂掉
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】
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 ‘标题’,

KEY province_index (province),
KEY number_index (number),
KEY commandId_index (commandId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=6666675293967 COMMENT=‘事件分析主表’
1 row in set (0.00 sec)

报错如下
[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

感觉可以提bug,

可以拿错误码去官方文档搜一下,看看有没有类似的说明

万亿级别估计触发bug了

是已知bug。升级版本修复
还有你这个7.2版本是个测试版本,生产环境不建议使用
https://github.com/pingcap/tiflash/pull/7912

image
选择版本的时候选择LTS,这个是官方稳定版本
image

是遇到bug了?实际数据只有千万,不知道这个自增ID怎么就达到6万亿级别了

有浪费的吧。
步长是多少,是1还是其他数字

现在主键最大的值到多少了?

ID是否设置了 AUTO_RANDOM?如果设置了,那id会有多个部分组成不是纯数据条数

image

有没有可能达到最大值了?

看那个建表语句的自增量,已经达到6万亿+了。实际数据只有1000多万。

步长是1

应该不是用的auto_random。
用的是自增AUTO_INCREMENT

在tikv里面没有什么问题,这张表同步到tiflash就会把tiflash搞挂,出现以上的报错。

你还是先升级吧,7.2这种dev版本有bug很正常

坐等看看

可以问下官方看看

升级到 LTS … 7.5.x

7.2 是 DMR,都没有 升级支持的…

表是不是修改过的?从auto_random改回到自增AUTO_INCREMENT?