重启 tidb 集群失败:failed to decode region range key

【 TiDB 使用环境】生产环境 /测试/ Poc
【 TiDB 版本】v6.1
【复现路径】做过哪些操作出现的问题

  1. 使用 raw api 插入数据
  2. 使用 tiup cluster edit-config tidb-cluster 修改了 tikv 的参数
  3. 使用 tiup cluster reload tidb-test 重新载入集群参数,这个时候会重启 tidb 集群

重启失败,报错如下:
Error: failed to restart: 172.29.17.178 tidb-4000.service, please check the instance’s log(/data/tidb/tidb-deploy/tidb-4000/log) for more detail.: timed out waiting for port 4000 to be started after 2m0s

查看 tidb.log

[tidb@iZwz9hvgbnrrdf9wikmb82Z log]$ tail -n10 /data/tidb/tidb-deploy/tidb-4000/log/tidb.log
[2023/02/27 16:58:15.524 +08:00] [INFO] [main.go:343] ["disable Prometheus push client"]
[2023/02/27 16:58:15.524 +08:00] [INFO] [store.go:75] ["new store"] [path=tikv://172.29.16.177:2379,172.29.16.176:2379,172.29.16.175:2379]
[2023/02/27 16:58:15.524 +08:00] [INFO] [client.go:392] ["[pd] create pd client with endpoints"] [pd-address="[172.29.16.177:2379,172.29.16.176:2379,172.29.16.175:2379]"]
[2023/02/27 16:58:15.524 +08:00] [INFO] [systime_mon.go:26] ["start system time monitor"]
[2023/02/27 16:58:15.526 +08:00] [INFO] [base_client.go:332] ["[pd] update member urls"] [old-urls="[http://172.29.16.177:2379,http://172.29.16.176:2379,http://172.29.16.175:2379]"] [new-urls="[http://172.29.16.175:2379,http://172.29.16.176:2379,http://172.29.16.177:2379]"]
[2023/02/27 16:58:15.526 +08:00] [INFO] [base_client.go:350] ["[pd] switch leader"] [new-leader=http://172.29.16.177:2379] [old-leader=]
[2023/02/27 16:58:15.526 +08:00] [INFO] [base_client.go:105] ["[pd] init cluster id"] [cluster-id=7202670086051910712]
[2023/02/27 16:58:15.526 +08:00] [INFO] [client.go:687] ["[pd] tso dispatcher created"] [dc-location=global]
[2023/02/27 16:58:15.527 +08:00] [INFO] [store.go:81] ["new store with retry success"]
[2023/02/27 16:58:15.528 +08:00] [FATAL] [session.go:3089] ["check bootstrapped failed"] [error="failed to decode region range key, key: \"6D426F6F7473747261FF704B657900000000FB0000000000000073\", err: invalid marker byte, group bytes \"usertable\""] [stack="github.com/pingcap/tidb/session.getStoreBootstrapVersion\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:3089\ngithub.com/pingcap/tidb/session.BootstrapSession\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:2860\nmain.createStoreAndDomain\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:296\nmain.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:202\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"]

我看 TIKV 官网上有说明不能混用 raw api 和 tidb,是不是这个原因导致 tidb 集群启动失败?如果是这个原因,有什么办法可以解决这个问题?
【遇到的问题:问题现象及影响】
【资源配置】
【附件:截图/日志/监控】

两种API确实不能混用,参考帖子:tikv raw kv api 和 transaction kv api写的key不兼容

1 个赞

尝试过。把您raw 写的数据删除没 ??
能删除成功不。删除完毕在尝试tidb启动

1 个赞

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