清理数据时报错,如何找到这个错误的 key

【 TiDB 使用环境】生产环境 /测试/ Poc
【 TiDB 版本】
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】
版本是 v7.1.5,清理数据时报错

delete from assistant_service_analysis_log where create_time <'2024-11-08 00:00:00' limit 1000;
ERROR 8141 (HY000): assertion failed: key: 7480000000000000d65f698000000000000001012d36333631333438ff37303030332d726fff6c655f696e666f5fff6261696b652d726fff6c655f626173655fff64657469616ce8b5ffb5e69993e998b300fe0380000000008e7292, assertion: Exist, start_ts: 453778682142523405, existing start ts: 0, existing commit ts: 0

如何找到这个错误的 key 绕过去

(root@127.0.0.1) [(none)]>select tidb_decode_key('7480000000000000d65f698000000000000001012d36333631333438ff37303030332d726fff6c655f696e666f5fff6261696b652d726fff6c655f626173655fff64657469616ce8b5ffb5e69993e998b300fe0380000000008e7292');
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_decode_key('7480000000000000d65f698000000000000001012d36333631333438ff37303030332d726fff6c655f696e666f5fff6261696b652d726fff6c655f626173655fff64657469616ce8b5ffb5e69993e998b300fe0380000000008e7292') |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {"index_id":1,"index_vals":"-636134870003-role_info_baike-role_base_detial赵晓阳, 9335442","table_id":214}                                                                                                  |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
select * from assistant_service_analysis_log where batch_id='-636134870003-role_info_baike-role_base_detial赵晓阳';
Empty set (0.01 sec)

按这个值去查,结果集是空,这是哪出错了

可以通过设置 set @@tidb_txn_assertion_level=OFF 跳过8141的检查

嗯 找到这个错误的数据,并删除了

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