incubator-seata-go icon indicating copy to clipboard operation
incubator-seata-go copied to clipboard

bugfix: rollback active xa connection fail

Open wt-better opened this issue 1 year ago • 1 comments

What happened:

see PR:https://github.com/apache/incubator-seata/pull/5131

wt-better avatar Jan 29 '24 13:01 wt-better

@smiletrl

wt-better avatar Feb 19 '24 06:02 wt-better

这个PR https://github.com/apache/incubator-seata-go/pull/672 参照Java 那边的PR https://github.com/apache/incubator-seata/pull/5131/files,修改的内容是一致的。但是这个错误 XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state 在Go的这里依然存在。

当全局事务时间过期了,但是本地RM的业务sql还没有跑完,此时TC发送RM Rollback的请求,本地会报这个错误。

smiletrl avatar Mar 07 '24 06:03 smiletrl

出现这个错误,建议业务层将sql执行查询的timeout时间缩短,或者将全局事务timeout的时间放长。代码层面,感觉除非强制关闭db connection,没有其他特别好的方案处理。就只能等tc 重试次数达到最高值。

smiletrl avatar Mar 07 '24 12:03 smiletrl