Skip to content

全局事务状态似乎永远无法进入到TimeoutRollbackRetrying #7470

@simzyoo

Description

@simzyoo

Check Ahead

Ⅰ. Issue Description

从代码来看,全局事务的状态要进入到TimeoutRollbackRetrying,路径如下:
a.从这里超时的全局事务状态从beigin 变成 TimeoutRollbacking

org.apache.seata.server.coordinator.DefaultCoordinator#init

 timeoutCheck.scheduleAtFixedRate(
            () -> SessionHolder.distributedLockAndExecute(TX_TIMEOUT_CHECK, this::timeoutCheck), 0,
            TIMEOUT_RETRY_PERIOD, TimeUnit.MILLISECONDS);

b.然后下面这个定时任务会重试回滚处于TimeoutRollbacking状态的全局事务

org.apache.seata.server.coordinator.DefaultCoordinator#init

retryRollbacking.scheduleAtFixedRate(
            () -> SessionHolder.distributedLockAndExecute(RETRY_ROLLBACKING, this::handleRetryRollbacking), 0,
            ROLLBACKING_RETRY_PERIOD, TimeUnit.MILLISECONDS);
Image

c.下一步这里的处理和首次回滚处理复用了同一个方法,这里retry为true,全局事务的状态是没法转变成TimeoutRollbackRetrying的

org.apache.seata.server.coordinator.DefaultCore#doGlobalRollback

Image

我跑了一个例子验证,超时触发的回滚,server不断重试,但全局事务的状态仍然是TimeoutRollbacking,也就是我认为TimeoutRollbackRetrying目前是一个无法到达的全局事务状态。

Ⅱ. Describe what happened

同上

Ⅲ. Describe what you expected to happen

No response

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

No response

Ⅴ. Anything else we need to know?

No response

Ⅵ. Environment

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions