v3.1.1版本下仍然出现错误 码为9007的错误

dml 类型包括:insert 、update、delete

官方描述如下

另外在 v3.0.8 及之后版本默认使用悲观事务模式,从而避免在事务提交的时候因为冲突而导致失败,无需修改应用程序。悲观事务模式下会在每个 DML 语句执行的时候,加上悲观锁,用于防止其他事务修改相同 Key,从而保证在最后提交的 prewrite 阶段不会出现写写冲突的情况。

现实出现问题

PreparedStatementCallback; uncategorized SQLException for SQL [insert into webox_client_token ( id,request_id,wallet_id,merchant_member_id,amount,business_type,status,create_date_time,complete_date_time,remark,wake_up_model) values (?,?,?,?,?,?,?,?,?,?,?)];
SQL state [HY000]; error code [9007];
Write conflict, txnStartTS=418113520069246983, conflictStartTS=418113520069246980, conflictCommitTS=418113520082354177, key={tableID=4133, indexID=1, indexValues={20200717089027468824628278804480, }}
primary={tableID=4133, indexID=1, indexValues={20200717089027468824628278804480, }} [try again later]; nested exception is java.sql.SQLException:
Write conflict, txnStartTS=418113520069246983, conflictStartTS=418113520069246980, conflictCommitTS=418113520082354177, key={tableID=4133, indexID=1, indexValues={20200717089027468824628278804480, }}
primary={tableID=4133, indexID=1, indexValues={20200717089027468824628278804480, }} [try again later]

PreparedStatementCallback; uncategorized SQLException for SQL [delete from cloud_member_role where id in ( ? ) ]; SQL state [HY000]; error code [9007]; Write conflict, txnStartTS=418088539455488005, conflictStartTS=418088539442380811, conflictCommitTS=418088539481702403, key={tableID=3127, indexID=1, indexValues={2c9778ad6e79a363016f41c255582057, }} primary={tableID=3127, indexID=1, indexValues={2c9778ad6e79a363016f41c255582057, }} [try again later]; nested exception is java.sql.BatchUpdateException: Write conflict, txnStartTS=418088539455488005, conflictStartTS=418088539442380811, conflictCommitTS=418088539481702403, key={tableID=3127, indexID=1, indexValues={2c9778ad6e79a363016f41c255582057, }} primary={tableID=3127, indexID=1, indexValues={2c9778ad6e79a363016f41c255582057, }} [try again later];;

PreparedStatementCallback; uncategorized SQLException for SQL [update cash_receipt_order set complete_date_time= ?, status= ? where id= ‘2c9778ed732c705001735124cadc3f23’ ]; SQL state [HY000]; error code [9007]; Write conflict, txnStartTS=418088485388288009, conflictStartTS=418088485388288003, conflictCommitTS=418088485401395201, key={tableID=4475, handle=3346035} primary={tableID=4475, handle=3346035} [try again later]; nested exception is java.sql.SQLException: Write conflict, txnStartTS=418088485388288009, conflictStartTS=418088485388288003, conflictCommitTS=418088485401395201, key={tableID=4475, handle=3346035} primary={tableID=4475, handle=3346035} [try again later]

版本信息

您好,请问您的集群是升级上来的还是新部署的?可以确认下当前集群是否开启悲观锁。另外可以参考下这个帖子确认下。已经启用悲观锁的情况下,还是会存在 error="[kv:9007]Write conflict ,是什么情况?

感谢回复,我先研究一下啊

好的,有问题请再反馈,多谢。

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