seata 全局事务结束逻辑优化

5ktev3wc  于 2个月前  发布在  其他
关注(0)|答案(2)|浏览(25)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

1、PR #4233 在处理lock数据残留时,将方法io.seata.server.session.GlobalSession#clean 判断是否有AT branch的逻辑移到外层,这会导致 TCC 全局事务在二阶段会执行clean资源清除动作(实际上TCC没有lock资源);
2、目前的全局事务end方法与各个模式是紧密耦合在一起的,导致逻辑复杂不易扩展,需要考虑将end方法抽象出来,每个模式具备自己的end逻辑;
3、其它优化:io.seata.server.coordinator.DefaultCore#doGlobalCommit 方法理论上只有 TCC 才会走到二阶段提交失败并且不可重复(PhaseTwo_CommitFailed_Unretryable)逻辑,不需要再判断是否可异步提交(canBeCommittedAsync)。

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

Just paste your stack trace here!

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. xxx
  2. xxx
  3. xxx

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version :
  • Seata version:
  • OS :
  • Others:
wwwo4jvm

wwwo4jvm1#

其实这里一直有疑惑,我理解所有二阶段下发都是可以异步的,毕竟全局事务的结果已经确定了。

除非TM侧需要坚挺RM的二阶段情况,从而做一些逻辑,否则貌似用不上同步。

fumotvh3

fumotvh32#

其实这里一直有疑惑,我理解所有二阶段下发都是可以异步的,毕竟全局事务的结果已经确定了。

除非TM侧需要坚挺RM的二阶段情况,从而做一些逻辑,否则貌似用不上同步。

TCC 根据业务形式二阶段是可以异步提交,但这个issue貌似不是讨论二阶段异步的话题。

相关问题