biedongbin commented on issue #7840:
URL: 
https://github.com/apache/incubator-seata/issues/7840#issuecomment-3641044728

   > 
根据SagaAnnotationActionInterceptorHandler的实现来看,目前使用了跟TCC一样的ActionInterceptorHandler,即在一阶段时会插入fencelog来保证防悬挂和空回滚,但是在SagaAnnotationResourceManager中并没有像TCCResourceManager那样调用
 DefaultCommonFenceHandler.get() 
.rollbackFence方法,导致saga注解模式的防悬挂和空回滚能力失效了,我认为是否像TCCResourceManager中那样处理rollback事件是否就可以达到空回滚和防悬挂的问题
   > 
   > According to the implementation of SagaAnnotationActionInterceptorHandler, 
it currently uses the same ActionInterceptorHandler as TCC — that is, it 
inserts a fence log in the first phase to ensure anti-suspension and empty 
rollback protection. However, in SagaAnnotationResourceManager, unlike 
TCCResourceManager, it does not call 
DefaultCommonFenceHandler.get().rollbackFence when processing rollback events, 
which causes the anti-suspension and empty rollback capabilities to fail (be 
ineffective) in Saga annotation mode. I think: if we handle the rollback event 
in SagaAnnotationResourceManager in the same way as in TCCResourceManager, 
would that solve the empty rollback and anti-suspension issues?
   
   我看了一下源码,实现是基于 Spring  事务模版 ,通过判断事务的状态来处理, 理论来讲可以实现,不过我这边的情况更复杂一些,涉及 多租户 
多数据源切换 就比较麻烦,复杂情况可能需要更轻量级一些的解决方案.
   
   另外  TCCResourceManager  的branchRollback 里面有执行 doBeforeTccRollback 。
   但是 SagaAnnotationResourceManager 内未执行任何 hook  。
   实际项目落地  补充业务方法执行 也需要 全局处理一些上下文的(比如 TraceId ),不然业务代码自己 处理也比较麻烦,侵入性太强
   
   


-- 
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]

Reply via email to