Skip to content

Commit

Permalink
bugfix: global session is always begin in saga mode for 2.x (apache#5464
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tuwenlin authored and liuqiufeng committed Apr 20, 2023
1 parent 8526b1d commit 43ce95a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changes/en-us/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ The version is updated as follows:
- [[#5372](https://github.com/seata/seata/pull/5372)] fix transaction timeout on client side not execute hook and failureHandler
- [[#4734](https://github.com/seata/seata/pull/4734)] check if table meta cache should be refreshed in AT mode
- [[#5426](https://github.com/seata/seata/pull/5426)] fix the GlobalTransactional annotation npe issue.
- [[#5464](https://github.com/seata/seata/pull/5464)] fix global session is always begin in saga mode

### optimize:
- [[#5208](https://github.com/seata/seata/pull/5208)] optimize throwable getCause once more
Expand Down Expand Up @@ -99,6 +100,7 @@ Thanks to these contributors for their code commits. Please report an unintended
- [l81893521](https://github.com/l81893521)
- [dmego](https://github.com/dmego)
- [zsp419](https://github.com/zsp419)
- [tuwenlin](https://github.com/tuwenlin)


Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
Expand Down
2 changes: 2 additions & 0 deletions changes/zh-cn/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#5351](https://github.com/seata/seata/pull/5351)] 优化 TCC 模式下的 RPC filter
- [[#5354](https://github.com/seata/seata/pull/5354)] 重构 RPC 集成模块
- [[#5370](https://github.com/seata/seata/pull/5370)] 优化事务失败处理 handler
- [[#5464](https://github.com/seata/seata/pull/5464)] 修复saga模式全局事务状态始终为Begin的问题

### security:
- [[#5172](https://github.com/seata/seata/pull/5172)] 修复一些安全漏洞的版本
Expand Down Expand Up @@ -101,6 +102,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [l81893521](https://github.com/l81893521)
- [dmego](https://github.com/dmego)
- [zsp419](https://github.com/zsp419)
- [tuwenlin](https://github.com/tuwenlin)

同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ public static void endCommitted(GlobalSession globalSession, boolean retryGlobal
MetricsPublisher.postSessionDoneEvent(globalSession, IdConstants.STATUS_VALUE_AFTER_COMMITTED_KEY, true,
beginTime, retryBranch);
} else {
if (globalSession.isSaga()) {
globalSession.setStatus(GlobalStatus.Committed);
globalSession.end();
}
MetricsPublisher.postSessionDoneEvent(globalSession, false, false);
}
}
Expand Down Expand Up @@ -201,6 +205,10 @@ public static void endRollbacked(GlobalSession globalSession, boolean retryGloba
MetricsPublisher.postSessionDoneEvent(globalSession, IdConstants.STATUS_VALUE_AFTER_ROLLBACKED_KEY, true,
beginTime, retryBranch);
} else {
if (globalSession.isSaga()) {
globalSession.setStatus(GlobalStatus.Rollbacked);
globalSession.end();
}
MetricsPublisher.postSessionDoneEvent(globalSession, GlobalStatus.Rollbacked, false, false);
}
}
Expand Down

0 comments on commit 43ce95a

Please sign in to comment.