tikv重启

【 TiDB 使用环境】生产环境 /测试/ Poc 生产环境
【 TiDB 版本】
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
tikv重启

[2024/06/21 21:55:46.474 +03:00] [WARN] [endpoint.rs:606] [error-response] [err=“Key is locked (will clean up) primary_lock: 7480000000000000DD5F69800000000000000203800000000002053603800000000E265CE6 lock_version: 450624525816037503 key: 7480000000000000DD5F698000000000000003038000000015281FFC03800000000002053603800000000000000003800000000000000003800000000000000003800000000E265CE6 lock_ttl: 3000 txn_size: 1 use_async_commit: true min_commit_ts: 450624525816037509”]
[2024/06/21 21:55:53.833 +03:00] [WARN] [endpoint.rs:606] [error-response] [err=“Key is locked (will clean up) primary_lock: 7480000000000000DD5F69800000000000000203800000000002053603800000000E260410 lock_version: 450624527742795973 key: 7480000000000000DD5F69800000000000000303800000001528203A03800000000002053603800000000000000003800000000000000003800000000000000003800000000E260410 lock_ttl: 3000 txn_size: 1 use_async_commit: true min_commit_ts: 450624527742795974”]
[2024/06/21 21:55:56.222 +03:00] [WARN] [endpoint.rs:606] [error-response] [err=“Key is locked (will clean up) primary_lock: 7480000000000000DD5F69800000000000000203800000000002053603800000000E260414 lock_version: 450624528371941463 key: 7480000000000000DD5F69800000000000000303800000001527F1F503800000000002053603800000000000000003800000000000000003800000000000000003800000000E260414 lock_ttl: 3000 txn_size: 1 use_async_commit: true min_commit_ts: 450624528371941464”]
[2024/06/21 21:55:58.324 +03:00] [WARN] [endpoint.rs:606] [error-response] [err=“Key is locked (will clean up) primary_lock: 7480000000000000DD5F69800000000000000203800000000002053603800000000E260419 lock_version: 450624528922443934 key: 7480000000000000DD5F698000000000000003038000000015281FFB03800000000002053603800000000000000003800000000000000003800000000000000003800000000E260419 lock_ttl: 3000 txn_size: 1 use_async_commit: true min_commit_ts: 450624528922443935”]
[2024/06/21 21:55:59.526 +03:00] [WARN] [endpoint.rs:606] [error-response] [err=“Key is locked (will clean up) primary_lock: 7480000000000000DD5F69800000000000000203800000000002053603800000000E26A8A1 lock_version: 450624529237016691 key: 7480000000000000DD5F69800000000000000303800000000A7A8C6A03800000000002053603800000000000000003800000000000000003800000000000000003800000000E26A8A1 lock_ttl: 3000 txn_size: 1 use_async_commit: true min_commit_ts: 450624529237016692”]
[2024/06/21 21:56:01.372 +03:00] [WARN] [endpoint.rs:606] [error-response] [err=“Key is locked (will clean up) primary_lock: 7480000000000000DD5F69800000000000000203800000000002053603800000000E26041C lock_version: 450624529721983078 key: 7480000000000000DD5F698000000000000003038000000015281EDA03800000000002053603800000000000000003800000000000000003800000000000000003800000000E26041C lock_ttl: 3000 txn_size: 1 use_async_commit: true min_commit_ts: 450624529721983079”]
[2024/06/21 21:56:02.768 +03:00] [WARN] [endpoint.rs:606] [error-response] [err=“Key is locked (will clean up) primary_lock: 7480000000000000DD5F69800000000000000203800000000002053603800000000E26A8A6 lock_version: 450624530088984628 key: 7480000000000000DD5F69800000000000000303800000001528155203800000000002053603800000000000000003800000000000000003800000000000000003800000000E26A8A6 lock_ttl: 3000 txn_size: 1 use_async_commit: true min_commit_ts: 450624530088984629”]

错误日志看到大量报错,然后tikv节点重启,
看监控,有大量not leader错误

随后tikv重启
[2024/06/21 21:56:12.399 +03:00] [INFO] [] [“New connected subchannel at 0x7efa158c3350 for subchannel 0x7efce064f540”]
[2024/06/21 21:56:12.414 +03:00] [FATAL] [lib.rs:465] [“index out of bounds: the len is 6 but the index is 6”] [backtrace=" 0: tikv_util::set_panic_hook::{{closure}}\n at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tikv_util/src/lib.rs:464:18\n 1: std::panicking::rust_panic_with_hook\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/panicking.rs:626:17\n 2: std::panicking::begin_panic_handler::{{closure}}\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/panicking.rs:519:13\n 3: std::sys_common::backtrace::__rust_end_short_backtrace\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/sys_common/backtrace.rs:141:18\n 4: rust_begin_unwind\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/panicking.rs:515:5\n 5: core::panicking::panic_fmt\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/core/src/panicking.rs:92:14\n 6: core::panicking::panic_bounds_check\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/core/src/panicking.rs:69:5\n 7: <usize as core::slice::index::SliceIndex<[T]>>::index_mut\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/core/src/slice/index.rs:190:14\n core::slice::index::<impl core::ops::index::IndexMut for [T]>::index_mut\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/core/src/slice/index.rs:26:9\n <alloc::vec::Vec<T,A> as core::ops::index::IndexMut>::index_mut\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/alloc/src/vec/mod.rs:2445:9\n tokio_timer::wheel::Wheel::insert\n at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/wheel/mod.rs:114:9\n tokio_timer::timer::Timer<T,N>::add_entry\n at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/timer/mod.rs:324:15\n 8: tokio_timer::timer::Timer<T,N>::process_queue\n at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/timer/mod.rs:301:21\n 9: <tokio_timer::timer::Timer<T,N> as tokio_executor::park::Park>::park\n at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/timer/mod.rs:361:9\n tokio_timer::timer::Timer<T,N>::turn\n at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/timer/mod.rs:256:21\n 10: tikv_util::timer::start_global_timer::{{closure}}\n at /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tikv/components/tikv_util/src/timer.rs:98:17\n 11: std::sys_common::backtrace::__rust_begin_short_backtrace\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/sys_common/backtrace.rs:125:18\n 12: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/thread/mod.rs:476:17\n 13: <std::panic::AssertUnwindSafe as core::ops::function::FnOnce<()>>::call_once\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/panic.rs:347:9\n 14: std::panicking::try::do_call\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/panicking.rs:401:40\n std::panicking::try\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/panicking.rs:365:19\n std::panic::catch_unwind\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/panic.rs:434:14\n std::thread::Builder::spawn_unchecked::{{closure}}\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/thread/mod.rs:475:30\n core::ops::function::FnOnce::call_once{{vtable.shim}}\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/core/src/ops/function.rs:227:5\n 15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/alloc/src/boxed.rs:1572:9\n <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/alloc/src/boxed.rs:1572:9\n std::sys::unix::thread::thread::new::thread_start\n at /rustc/2faabf579323f5252329264cc53ba9ff803429a3/library/std/src/sys/unix/thread.rs:91:17\n 16: start_thread\n 17: __clone\n"] [location=/rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/wheel/mod.rs:114] [thread_name=timer]

【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】

Key is locked (will clean up)
你这个是在还有事务发生的时候做了操作吗

都是正常业务,一直都没异常

看网上的帖子,这似乎是一个bug,我们应该如何处理这个bug?

看之前的类似问题,是因为长时间没有重启,触发了bug

确实是的

:thinking:那就只能考虑升级了。

1 个赞

5.4.0的bug,每两年tikv会重启一次,升级解决吧

version: v5.4.0 升级最新小版本吧

根据日志“Key is locked”错误通常表示在执行事务时,某个键被其他事务锁定。这可能是由于事务未正确提交或回滚导致的。