创建 TiFlash 数据副本时 TiFlash 实例失联

【 TiDB 使用环境】生产环境 /测试/ Poc
【附件:截图/日志/监控】
[ERROR] [Exception.cpp:90] [“Code: 49, e.displayText() = DB::Exception: Check compare(range.getStart(), ext_file.range.getStart()) <= 0 && compare(range.getEnd(), ext_file.range.getEnd()) >= 0 failed: Detected illegal region boundary: range=[940850,950127) file_range=[940850,950128) . TiFlash will exit to prevent data inconsistency. If you accept data inconsistency and want to continue the service, set profiles.default.dt_enable_ingest_check=false ., e.what() = DB::Exception, Stack trace:\n\n\n 0x18e2808\tDB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int) [tiflash+26093576]\n \tdbms/src/Common/Exception.h:46\n 0x66c5868\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+107763816]\n \tdbms/src/Storages/DeltaMerge/DeltaMergeStore_Ingest.cpp:562\n 0x7048ec0\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+117739200]\n \tdbms/src/Storages/DeltaMerge/DeltaMergeStore.h:305\n 0x70e493c\tvoid DB::KVStore::checkAndApplyPreHandledSnapshotDB::RegionPtrWithSnapshotFiles(DB::RegionPtrWithSnapshotFiles const&, DB::TMTContext&) [tiflash+118376764]\n \tdbms/src/Storages/Transaction/ApplySnapshot.cpp:139\n 0x70e36e0\tvoid DB::KVStore::applyPreHandledSnapshotDB::RegionPtrWithSnapshotFiles(DB::RegionPtrWithSnapshotFiles const&, DB::TMTContext&) [tiflash+118372064]\n \tdbms/src/Storages/Transaction/ApplySnapshot.cpp:430\n 0x714f258\tApplyPreHandledSnapshot [tiflash+118813272]\n \tdbms/src/Storages/Transaction/ProxyFFI.cpp:664\n 0xfffdecf7e108\t$LT$engine_store_ffi…observer…TiFlashObserver$LT$T$C$ER$GT$$u20$as$u20$raftstore…coprocessor…ApplySnapshotObserver$GT$::post_apply_snapshot::h37b78235775c5464 [libtiflash_proxy.so+23388424]\n 0xfffdedcec374\traftstore::store::worker::region::Runner$LT$EK$C$R$C$T$GT$::handle_pending_applies::hea284cfca343c5ad [libtiflash_proxy.so+37471092]\n 0xfffded439a6c\tyatp::task::future::RawTask$LT$F$GT$::poll::h009a768630ae99e9 [libtiflash_proxy.so+28351084]\n 0xfffdee9e61ac\t$LT$yatp…task…future…Runner$u20$as$u20$yatp…pool…runner…Runner$GT$::handle::h21119c0ed142ec41 [libtiflash_proxy.so+51077548]\n 0xfffded05bc90\tstd::sys_common::backtrace::__rust_begin_short_backtrace::h81ce124c88a5854e [libtiflash_proxy.so+24296592]\n 0xfffded0a5950\tcore::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hfd9faa5e3b4e1b6c [libtiflash_proxy.so+24598864]\n 0xfffdee27efa8\tstd::sys::unix::thread::thread::new::thread_start::heb4b82eb38eaaa15 [libtiflash_proxy.so+43315112]\n 0xfffdeb7d88cc\t [libpthread.so.0+35020]\n 0xfffdeb5ca1ec\t [libc.so.6+893420]”] [source=“void DB::ApplyPreHandledSnapshot(DB::EngineStoreServerWrap *, PreHandledSnapshot *) [PreHandledSnapshot = DB::PreHandledSnapshotWithFiles]”] [thread_id=286]

2 个赞

这个问题前几天见过。

不同的是,7.1.1代码报错信息这里还没有tableid,定位不到是那个表。

https://github.com/pingcap/tiflash/blob/v7.1.1/dbms/src/Storages/DeltaMerge/DeltaMergeStore_Ingest.cpp#L564C51-L564C51

可能还需要自己一个表一个表试一下。
但实际解决方法,都是要么tikv bad-ssts查一下是否有overlap sst,要么按照提示给的设置一下tiflash参数跳过这段检查。

给了你建议,看你能否接受。。。

为啥会数据不一致?

这个参数是在哪里调整的,文档好像没有找到,有相关说明的话可以麻烦发一下

估计是7.1.1的bug吧,以前好像也在论坛看见类似的问题

文档里面确实没有,这个字面推测就是设置不必须进行一致性检查,应该是bug导致,如果接受不了,可以把对应的表找出来,确定下具体的问题在哪。。

不太清楚这个意思,是说这个提示的配置实际设置不了吗,只能去排除表的数据一致性吗

如果你说的是提示里面的这个profiles.default.dt_enable_ingest_check=false配置项的话,确实文档里面没有。

但这个提示信息里面的配置项应该是可以生效的。毕竟
https://github.com/pingcap/tiflash/blob/v7.1.1/dbms/src/Storages/DeltaMerge/DeltaMergeStore_Ingest.cpp#L558C76-L558C76

可以看到进这个检查前,tiflash确实曾经检查过这个配置项是否打开。

试了多次各种调速都是一样的现象,可能是创建副本的表数据量较大的原因,最后是通过通过一张同样Schema的空表,先建立了TiFlash副本,然后再将原有表的数据逐步同步到新表就可以了。

1 个赞

错误信息中提到了一个非法的区域边界,这可能导致数据不一致。为了防止数据不一致,TiFlash 会退出

最好比最新的第一个版本,稳定可靠性高点

此话题已在最后回复的 60 天后被自动关闭。不再允许新回复。