tikv服务自动重启了

【 TiDB 使用环境】生产环境
【 TiDB 版本】v5.0.2
【复现路径】基本是空跑
【遇到的问题:问题现象及影响】晚上18点42分收到报警,tikv服务挂了,后来登上服务器查看,tikv服务挂了以后自动重启了
后来查看tikv.log发现了报错
[2023/09/12 18:42:10.139 +08:00] [FATAL] [lib.rs:465] [“index out of bounds: the len is 6 but the index is 6”] [backtrace="stack backtrace:
0: tikv_util::set_panic_hook::{{closure}}
at /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tikv/components/tikv_util/src/lib.rs:464
1: std::panicking::rust_panic_with_hook
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35//library/std/src/panicking.rs:595
2: std::panicking::begin_panic_handler::{{closure}}
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35//library/std/src/panicking.rs:497
3: std::sys_common::backtrace::__rust_end_short_backtrace
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35//library/std/src/sys_common/backtrace.rs:141
4: rust_begin_unwind
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35//library/std/src/panicking.rs:493
5: core::panicking::panic_fmt
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35//library/core/src/panicking.rs:92
6: core::panicking::panic_bounds_check
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35//library/core/src/panicking.rs:69
7: <usize as core::slice::index::SliceIndex<[T]>>::index_mut
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/core/src/slice/index.rs:188
core::slice::index::<impl core::ops::index::IndexMut for [T]>::index_mut
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/core/src/slice/index.rs:26
<alloc::vec::Vec<T,A> as core::ops::index::IndexMut>::index_mut
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/alloc/src/vec/mod.rs:2054
tokio_timer::wheel::Wheel::insert
at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/wheel/mod.rs:114
tokio_timer::timer::Timer<T,N>::add_entry
at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/timer/mod.rs:324
8: tokio_timer::timer::Timer<T,N>::process_queue
at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/timer/mod.rs:301
9: <tokio_timer::timer::Timer<T,N> as tokio_executor::park::Park>::park
at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/timer/mod.rs:361
tokio_timer::timer::Timer<T,N>::turn
at /rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/timer/mod.rs:256
10: tikv_util::timer::start_global_timer::{{closure}}
at /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tikv/components/tikv_util/src/timer.rs:95
11: std::sys_common::backtrace::__rust_begin_short_backtrace
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/std/src/sys_common/backtrace.rs:125
12: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/std/src/thread/mod.rs:474
13: <std::panic::AssertUnwindSafe as core::ops::function::FnOnce<()>>::call_once
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/std/src/panic.rs:322
14: std::panicking::try::do_call
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/std/src/panicking.rs:379
std::panicking::try
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/std/src/panicking.rs:343
std::panic::catch_unwind
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/std/src/panic.rs:396
std::thread::Builder::spawn_unchecked::{{closure}}
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/std/src/thread/mod.rs:473
core::ops::function::FnOnce::call_once{{vtable.shim}}
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/core/src/ops/function.rs:227
15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/alloc/src/boxed.rs:1484
<alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35/library/alloc/src/boxed.rs:1484
std::sys::unix::thread::thread::new::thread_start
at /rustc/bc39d4d9c514e5fdb40a5782e6ca08924f979c35//library/std/src/sys/unix/thread.rs:71
16: start_thread
17: __clone
"] [location=/rust/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/wheel/mod.rs:114] [thread_name=timer]

好像是遇到了Bug了,这个问题应该怎么解决

tikv.log (6.9 MB)
这是tikv的日志 出错的时间是18点42分

TiKV running over 2 years may panic · Issue #11940 · tikv/tikv (github.com)
tikv是不是2年没重启了,这个是个已知bug。。。。。
建议升级版本吧。

好的 多谢了

前一阵子刚碰到这个bug,可以全局扫描下, 提前1个月做个预警,提前处理下

select INSTANCE,START_TIME,TIMESTAMPDIFF(day,START_TIME,now()) from information_schema.CLUSTER_INFO where type=‘tikv’ and TIMESTAMPDIFF(day, START_TIME, now())>765;

我们也遇到了这个问题,当时找了好久才查到是bug :mask:

两年没有重启过了吧 已知bug