freeloop-xiao commented on issue #6383: URL: https://github.com/apache/incubator-seata/issues/6383#issuecomment-1972520839
<img width="1428" alt="image" src="https://github.com/apache/incubator-seata/assets/19429925/fcd5710c-c8d8-4b3b-a299-6def60910059"> 在并发的情况下,事务1 、事务2 在 代码上图代码A点执行 select ... from tcc_fence_log for update语句时, 如果查询事务记录不存在会添加间隙锁,如果两个事务添加的间隙锁范围包含两个事务之后insert事务记录的记录范围(上图代码B) 事务1会添加插入意向锁进入等待,等待事务2提交事务释放间隙锁 事务2会添加插入意向锁进入等待,等待事务1提交事务释放间隙锁 这就会形成数据库死锁; 日志信息: <img width="1458" alt="image" src="https://github.com/apache/incubator-seata/assets/19429925/f7c451c9-dc91-4f6c-be11-39a65025d1d4"> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
