incubator-seata-go
incubator-seata-go copied to clipboard
bugfix: rollback active xa connection fail
@smiletrl
这个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的请求,本地会报这个错误。
出现这个错误,建议业务层将sql执行查询的timeout时间缩短,或者将全局事务timeout的时间放长。代码层面,感觉除非强制关闭db connection,没有其他特别好的方案处理。就只能等tc 重试次数达到最高值。