Open tuwenlin opened 9 months ago
I have confirmed that this issue does exist. The expectation is that if the try operation fails, the cancel logic should continue to be executed.
I have confirmed that this issue does exist. The expectation is that if the try operation fails, the cancel logic should continue to be executed.
Based on the current situation, enabling anti-suspension is only suitable for try operations that perform local database operations. I have considered not putting the insertion of fence_log and try operations in the same transaction, but this may lead to a scenario where the global transaction times out before the try operation is executed, and the rollback has already been carried out, ultimately resulting in a suspension.
I have confirmed that this issue does exist. The expectation is that if the try operation fails, the cancel logic should continue to be executed.
这个问题可以将对应的分支事务关闭防悬挂,因为防悬挂适用的是本地事务相关的操作,如果try失败,代表本地事务已经回滚,所以不需要执行cancel.如果需要执行cancel,大概率不是事务性的分支,可以关闭防悬挂,因为防悬挂对其也无用 This problem can turn off the anti-suspension of the corresponding branch transaction, because the anti-suspension applies to the operation related to the local transaction. If the try fails, it means that the local transaction has been rolled back, so there is no need to cancel. If you need to perform cancel, there is a high probability that it is not a transactional branch, you can turn off the anti-suspension, because the anti-suspension is useless for it
I have confirmed that this issue does exist. The expectation is that if the try operation fails, the cancel logic should continue to be executed.
这个问题可以将对应的分支事务关闭防悬挂,因为防悬挂适用的是本地事务相关的操作,如果try失败,代表本地事务已经回滚,所以不需要执行cancel.如果需要执行cancel,大概率不是事务性的分支,可以关闭防悬挂,因为防悬挂对其也无用 This problem can turn off the anti-suspension of the corresponding branch transaction, because the anti-suspension applies to the operation related to the local transaction. If the try fails, it means that the local transaction has been rolled back, so there is no need to cancel. If you need to perform cancel, there is a high probability that it is not a transactional branch, you can turn off the anti-suspension, because the anti-suspension is useless for it
关闭防悬挂,幂等和空回滚问题怎么处理呢?
prepare阶段,插入tcc_fence_log和targetCallback.execute();在一个事务里,targetCallback.execute()如果有了异常,随后插入的tcc_fence_log也会回滚,然后在rollback方法里,从数据库查到的tcc_fence_log为null,就不会再走实际的回滚方法了