Skip to content

tiflash panic when shared lock is enabled #10883

@JaySon-Huang

Description

@JaySon-Huang

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

tiflash serve normally when tidb_foreign_key_check_in_shared_lock is ON

2. What did you expect to see? (Required)

3. What did you see instead (Required)

2026-06-02 15:17:30
[2026/06/02 07:17:29.167 +00:00] [FATAL] [Exception.cpp:98] ["Code: 9008, e.displayText() = DB::Exception: Raw TiDB PK: ?, Prewrite ts: 466717152344801524 can not found in default cf for key: ?, region_id: 454598, applied_index: 23184948: (applied_term: 113), e.what() = DB::Exception, Stack trace:
  0xaaaae9113d04    DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, int) [tiflash+36584708]
                    dbms/src/Common/StackTrace.cpp:25
  0xaaaaf044f9c4    DB::RegionData::readDataByWriteIt(std::__1::__map_const_iterator<std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::pair<DB::RawTiDBPK, unsigned long>, std::__1::tuple<std::__1::shared_ptr<DB::StringObject<true> const>, std::__1::shared_ptr<DB::StringObject<false> const>, DB::RecordKVFormat::InnerDecodedWriteCFValue>>, std::__1::__tree_node<std::__1::__value_type<std::__1::pair<DB::RawTiDBPK, unsigned long>, std::__1::tuple<std::__1::shared_ptr<DB::StringObject<true> const>, std::__1::shared_ptr<DB::StringObject<false> const>, DB::RecordKVFormat::InnerDecodedWriteCFValue>>, void*>*, long>> const&, bool, unsigned long, unsigned long, bool) [tiflash+157415876]
                    dbms/src/Storages/KVStore/MultiRaft/RegionData.cpp:197
  0xaaaaf03877a0    DB::Region::readDataByWriteIt(std::__1::__map_const_iterator<std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::pair<DB::RawTiDBPK, unsigned long>, std::__1::tuple<std::__1::shared_ptr<DB::StringObject<true> const>, std::__1::shared_ptr<DB::StringObject<false> const>, DB::RecordKVFormat::InnerDecodedWriteCFValue>>, std::__1::__tree_node<std::__1::__value_type<std::__1::pair<DB::RawTiDBPK, unsigned long>, std::__1::tuple<std::__1::shared_ptr<DB::StringObject<true> const>, std::__1::shared_ptr<DB::StringObject<false> const>, DB::RecordKVFormat::InnerDecodedWriteCFValue>>, void*>*, long>> const&, bool, bool) [tiflash+156596128]
                    dbms/src/Storages/KVStore/Region.cpp:48
  0xaaaaf04cd3d4    DB::Region::CommittedScanner::tryNext() [tiflash+157930452]
                    dbms/src/Storages/KVStore/Decode/RegionScanner.cpp:65
  0xaaaaf04bfe94    DB::ReadRegionCommitCache(std::__1::shared_ptr<DB::Region> const&, bool) [tiflash+157875860]
                    dbms/src/Storages/KVStore/Decode/RegionScanner.cpp:52
  0xaaaaf04c050c    DB::RegionTable::writeCommittedByRegion(DB::Context&, std::__1::shared_ptr<DB::Region> const&, std::__1::vector<DB::RegionDataReadInfo, std::__1::allocator<DB::RegionDataReadInfo>>&, std::__1::shared_ptr<DB::Logger> const&, bool) [tiflash+157877516]
                    dbms/src/Storages/KVStore/Decode/PartitionStreams.cpp:410
  0xaaaaf0439d4c    DB::Region::handleWriteRaftCmd(DB::WriteCmdsView const&, unsigned long, unsigned long, DB::TMTContext&) [tiflash+157326668]
                    dbms/src/Storages/KVStore/MultiRaft/RaftCommands.cpp:514
  0xaaaaf04409bc    DB::KVStore::handleWriteRaftCmdInner(DB::WriteCmdsView const&, unsigned long, unsigned long, unsigned long, DB::TMTContext&, std::__1::optional<DB::DM::RaftWriteResult>&) [tiflash+157354428]
                    dbms/src/Storages/KVStore/MultiRaft/RaftCommandsKVS.cpp:62
  0xaaaaf0440820    DB::KVStore::handleWriteRaftCmd(DB::WriteCmdsView const&, unsigned long, unsigned long, unsigned long, DB::TMTContext&) [tiflash+157354016]
                    dbms/src/Storages/KVStore/MultiRaft/RaftCommandsKVS.cpp:41
  0xaaaaf03d9490    HandleWriteRaftCmd [tiflash+156931216]
                    dbms/src/Storages/KVStore/FFI/ProxyFFI.cpp:100
  0xffff8ac17c94    engine_store_ffi::core::forward_raft::command::_$LT$impl$u20$engine_store_ffi..core..forwarder..ProxyForwarder$LT$T$C$ER$GT$$GT$::post_exec_query::hfe027dbbd02935d5 [libtiflash_proxy.so+27335828]
  0xffff8b705fe4    raftstore::store::fsm::apply::ApplyDelegate$LT$EK$GT$::process_raft_cmd::h6f223f23ab944674 [libtiflash_proxy.so+38797284]
  0xffff8b70c228    raftstore::store::fsm::apply::ApplyDelegate$LT$EK$GT$::handle_raft_committed_entries::hf53b3c8115364e02 [libtiflash_proxy.so+38822440]
  0xffff8b6ecef0    raftstore::store::fsm::apply::ApplyFsm$LT$EK$GT$::handle_apply::h65f5904b9cbfe9f4 [libtiflash_proxy.so+38694640]
  0xffff8b6f08fc    raftstore::store::fsm::apply::ApplyFsm$LT$EK$GT$::handle_tasks::h6f37af45303455a2 [libtiflash_proxy.so+38709500]
  0xffff8ac3fb6c    _$LT$raftstore..store..fsm..apply..ApplyPoller$LT$EK$GT$$u20$as$u20$batch_system..batch..PollHandler$LT$raftstore..store..fsm..apply..ApplyFsm$LT$EK$GT$$C$raftstore..store..fsm..apply..ControlFsm$GT$$GT$::handle_normal::hd7f746db334a6ebc [libtiflash_proxy.so+27499372]
  0xffff8abc2388    batch_system::batch::Poller$LT$N$C$C$C$Handler$GT$::poll::h4b08ea66aa68d859 [libtiflash_proxy.so+26985352]
  0xffff8ac6d96c    std::sys_common::backtrace::__rust_begin_short_backtrace::h04d602d19fd754e3 [libtiflash_proxy.so+27687276]
  0xffff8acbc3e8    core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h259833b834af048f [libtiflash_proxy.so+28009448]
  0xffff8bf219e0    std::sys::unix::thread::Thread::new::thread_start::ha7f54e8a2674c51b [libtiflash_proxy.so+47299040]
  0xffff88ebce00    start_thread [libc.so.6+527872]
  0xffff88f2749c    thread_start [libc.so.6+963740]"] [source="EngineStoreApplyRes DB::HandleWriteRaftCmd(const EngineStoreServerWrap *, WriteCmdsView, RaftCmdHeader)"] [thread_id=27]
2026-06-02 16:09:14	
[2026/06/02 08:09:14.802 +00:00] [WARN] [command.rs:318] ["skip shared lock while committing, region id 454598 key [120, 0, 0, 2, 116, 128, 0, 0, 0, 0, 0, 0, 131, 95, 114, 1, 28, 96, 28, 65, 28, 66, 28, 143, 255, 28, 61, 28, 61, 28, 68, 28, 68, 255, 2, 13, 28, 96, 28, 64, 28, 71, 255, 28, 143, 2, 13, 28, 65, 28, 62, 255, 28, 71, 28, 229, 2, 13, 28, 69, 255, 28, 70, 28, 61, 28, 143, 2, 13, 255, 28, 70, 28, 229, 28, 61, 28, 229, 255, 28, 65, 28, 70, 28, 71, 28, 122, 255, 28, 65, 28, 229, 28, 64, 28, 122, 255, 0, 0, 0, 0, 0, 0, 0, 0, 247], commit ts 466712692777287790, log index 23168872"]
2026-06-02 16:06:32	
[2026/06/02 08:06:32.237 +00:00] [WARN] [command.rs:318] ["skip shared lock while committing, region id 455206 key [120, 0, 0, 2, 116, 128, 0, 0, 0, 0, 0, 2, 57, 95, 114, 1, 28, 96, 28, 64, 28, 143, 28, 143, 255, 28, 61, 28, 64, 28, 69, 28, 66, 255, 2, 13, 28, 229, 28, 71, 28, 61, 255, 28, 229, 2, 13, 28, 65, 28, 70, 255, 28, 66, 28, 64, 2, 13, 28, 96, 255, 28, 64, 28, 70, 28, 61, 2, 13, 255, 28, 65, 28, 143, 28, 63, 28, 66, 255, 28, 70, 28, 65, 28, 64, 28, 71, 255, 28, 229, 28, 64, 28, 71, 28, 66, 255, 0, 0, 0, 0, 0, 0, 0, 0, 247], commit ts 466717377526497492, log index 13635133"]

4. What is your TiFlash version? (Required)

https://github.com/pingcap/tiflash/releases/tag/v26.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/storagenextgenIndicates that the Issue or PR belongs to the nextgen kernel architecture.severity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions