悲观事务模式下报错写入冲突错误

【 TiDB 使用环境】线上 【 TiDB 版本】5.3 【遇到的问题】悲观锁事务遇到写冲突报错 【复现路径】偶发的update操作 【问题现象及影响】update执行失败导致事务回滚

报错日志: [2022/07/17 18:34:23.377 +08:00] [WARN] [session.go:721] [“can not retry txn”] [conn=5567757] [label=general] [error="[kv:9007]Write conflict, txnStartTS=434648924385705994, conflictStartTS=434648924385705995, conflictCommitTS=434648924385706003, key={tableID=89, indexID=5, indexValues={1717698306, 1850243498146817280,1850243106666971136, 637967337, }} primary={tableID=89, indexID=1, indexValues={110121367726914335, }} [try again later]"] [IsBatchInsert=false] [IsPessimistic=true] [InRestrictedSQL=false] [tidb_retry_limit=10] [tidb_disable_txn_auto_retry=true]

[2022/07/17 18:34:23.377 +08:00] [WARN] [session.go:737] [“commit failed”] [conn=5567757] [“finished txn”=“Txn{state=invalid}”] [error="[kv:9007]Write conflict,txnStartTS=434648924385705994, conflictStartTS=434648924385705995, conflictCommitTS=434648924385706003, key={tableID=89, indexID=5, indexValues={1717698306, 1850243498146817280, 1850243106666971136, 637967337, }} primary={tableID=89, indexID=1, indexValues={110121367726914335, }} [try again later]"]

[2022/07/17 18:34:23.377 +08:00] [WARN] [session.go:1583] [“run statement failed”] [conn=5567757] [schemaVersion=96] [error=“previous statement: /*DW: primary=true :/update trade_order_seller SET seller_feature = ‘{“incomeStatus”:0}’, delivery_no = ‘DN101005’ where seller_id = 44 and sub_order_no = ‘11’: [kv:9007]Write conflict, txnStartTS=434648924385705994, conflictStartTS=434648924385705995, conflictCommitTS=434648924385706003, key={tableID=89, indexID=5, indexValues={1717698306, 1850243498146817280, 1850243106666971136, 637967337, }} primary={tableID=89, indexID=1, indexValues={110121367726914335, }} [try again later]”] [session="{\ “currDBName”: “db”,\ “id”: ,\ “status”:0,\ “strictMode”: true,\ “user”: {\ “Username”: “db”,\ “Hostname”: “10.240.”,\ “CurrentUser”: false,\ "AuthUsername": “db”,\ “AuthHostname”: “%”\ }\ }"]

[2022/07/17 18:34:23.377 +08:00] [INFO] [conn.go:1069] [“command dispatched failed”] [conn=5567757] [connInfo=“id:5567757, addr:10.240.61.77:24602 status:0, collation:utf8_general_ci, user:dw_trade_order_seller_db”] [command=Query] [status=“inTxn:0, autocommit:0”] [sql=commit] [txn_mode=PESSIMISTIC] [err="[kv:9007]Write conflict, txnStartTS=434648924385705994, conflictStartTS=434648924385705995, conflictCommitTS=434648924385706003, key={tableID=89, indexID=5, indexValues={1717698306, 1850243498146817280, 1850243106666971136, 637967337, }} primary={tableID=89, indexID=1, indexValues={110121367726914335, }} [try again later]\ previousstatement: /DW: primary=true :DW/update trade_order_seller SET seller_feature = ‘{"incomeS}’, delivery_no = ‘DN10100’ where seller_id = 17 and sub_order_no = ‘11’"]

哈 来支持下 我之前提的那个问题没有解决,到现在线上都在报Write conflict错(频率非常低,所以也懒得管了)- - 解决方案是从业务上进行的重试,插个眼看看这个帖子有没有解决方案

该问题是由TiDB的bug导致,可升级为5.3.2版本解决该问题;
https://github.com/tikv/tikv/issues/11612

这个bug都影响哪些版本,哪些版本解决该问题,除了升级有没有其他解决方式

没有其他解决方案,只能升级,会影响5.3相关版本。

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