diff --git a/changes/en-us/develop.md b/changes/en-us/develop.md index 4cecc10fd6a..37a29a297fa 100644 --- a/changes/en-us/develop.md +++ b/changes/en-us/develop.md @@ -30,6 +30,7 @@ Add changes here for all PR submitted to the develop branch. - [[#5004](https://github.com/seata/seata/pull/5004)] fix duplicate image row for update join - [[#5033](https://github.com/seata/seata/pull/5033)] fix null exception when sql columns is empty for insert on duplicate - [[#5038](https://github.com/seata/seata/pull/5038)] remove @EnableConfigurationProperties({SagaAsyncThreadPoolProperties.class}) +- [[#5050](https://github.com/seata/seata/pull/5050)] fix global session is not change to Committed in saga mode ### optimize: diff --git a/changes/zh-cn/develop.md b/changes/zh-cn/develop.md index 7c56f38dbdf..41efe22c743 100644 --- a/changes/zh-cn/develop.md +++ b/changes/zh-cn/develop.md @@ -32,6 +32,7 @@ - [[#5004](https://github.com/seata/seata/pull/5004)] 修复mysql update join行数据重复的问题 - [[#5033](https://github.com/seata/seata/pull/5033)] 修复InsertOnDuplicateUpdate的SQL语句中无插入列字段导致的空指针问题 - [[#5038](https://github.com/seata/seata/pull/5038)] 修复SagaAsyncThreadPoolProperties冲突问题 +- [[#5050](https://github.com/seata/seata/pull/5050)] 修复Saga模式下全局状态未正确更改成Committed ### optimize: diff --git a/server/src/main/java/io/seata/server/coordinator/DefaultCore.java b/server/src/main/java/io/seata/server/coordinator/DefaultCore.java index 9aa7d38bab5..80d086dcaa5 100644 --- a/server/src/main/java/io/seata/server/coordinator/DefaultCore.java +++ b/server/src/main/java/io/seata/server/coordinator/DefaultCore.java @@ -259,14 +259,14 @@ public boolean doGlobalCommit(GlobalSession globalSession, boolean retrying) thr LOGGER.info("Committing global transaction is NOT done, xid = {}.", globalSession.getXid()); return false; } - if (!retrying) { - //contains not AT branch - globalSession.setStatus(GlobalStatus.Committed); - } } // if it succeeds and there is no branch, retrying=true is the asynchronous state when retrying. EndCommitted is // executed to improve concurrency performance, and the global transaction ends.. if (success && globalSession.getBranchSessions().isEmpty()) { + if (!retrying) { + //contains not AT branch + globalSession.setStatus(GlobalStatus.Committed); + } SessionHelper.endCommitted(globalSession, retrying); LOGGER.info("Committing global transaction is successfully done, xid = {}.", globalSession.getXid()); }