From 348ffc2c5c22874eb520dcd091b42756df436864 Mon Sep 17 00:00:00 2001 From: tuwenlin Date: Wed, 22 Mar 2023 15:09:53 +0800 Subject: [PATCH 1/4] saga status bugfix for 2.x --- .../main/java/io/seata/server/session/SessionHelper.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/main/java/io/seata/server/session/SessionHelper.java b/server/src/main/java/io/seata/server/session/SessionHelper.java index f1c85975a9d..9da3df76cd9 100644 --- a/server/src/main/java/io/seata/server/session/SessionHelper.java +++ b/server/src/main/java/io/seata/server/session/SessionHelper.java @@ -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); } } @@ -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); } } From dbd7414b0ab870fc8078eabd88b9fc21e0832e6a Mon Sep 17 00:00:00 2001 From: tuwenlin Date: Wed, 22 Mar 2023 15:18:45 +0800 Subject: [PATCH 2/4] register change --- changes/en-us/develop.md | 3 ++- changes/zh-cn/develop.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changes/en-us/develop.md b/changes/en-us/develop.md index 6a6f7c8cde6..bf2380c1946 100644 --- a/changes/en-us/develop.md +++ b/changes/en-us/develop.md @@ -8,7 +8,8 @@ Add changes here for all PR submitted to the develop branch. ### bugfix: - [[#5194](https://github.com/seata/seata/pull/5194)] fix wrong keyword order for oracle when creating a table - [[#5021](https://github.com/seata/seata/pull/5201)] Fix JDK Reflection for Spring origin proxy failed in JDK17 -- [[#5224](https://github.com/seata/seata/pull/5224)] fix oracle initialize script index_name is duplicate +- [[#5224](https://github.com/seata/seata/pull/5224)] fix oracle initialize script index_name is duplicate +- [[#5464](https://github.com/seata/seata/pull/5464)] fix global session is always begin in saga mode ### optimize: - [[#5212](https://github.com/seata/seata/pull/5212)] optimize log message level diff --git a/changes/zh-cn/develop.md b/changes/zh-cn/develop.md index 1721a178503..7cd35d611be 100644 --- a/changes/zh-cn/develop.md +++ b/changes/zh-cn/develop.md @@ -10,6 +10,7 @@ - [[#5194](https://github.com/seata/seata/pull/5194)] 修复使用Oracle作为服务端DB存储时的建表失败问题 - [[#5021](https://github.com/seata/seata/pull/5201)] 修复 JDK17 下获取 Spring 原始代理对象失败的问题 - [[#5224](https://github.com/seata/seata/pull/5224)] 修复 oracle初始化脚本索引名重复的问题 +- [[#5464](https://github.com/seata/seata/pull/5464)] 修复saga模式全局事务状态始终为Begin的问题 ### optimize: - [[#5212](https://github.com/seata/seata/pull/5212)] 优化不合理的日志信息级别 From f97c4934d8cf0d90835df76631281aa7f4bf0f84 Mon Sep 17 00:00:00 2001 From: tuwenlin Date: Wed, 22 Mar 2023 15:30:13 +0800 Subject: [PATCH 3/4] conflict --- changes/en-us/develop.md | 4 ++-- changes/zh-cn/develop.md | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/changes/en-us/develop.md b/changes/en-us/develop.md index a354b0e0d5c..82a65cfcacf 100644 --- a/changes/en-us/develop.md +++ b/changes/en-us/develop.md @@ -8,13 +8,12 @@ Add changes here for all PR submitted to the develop branch. ### bugfix: - [[#5194](https://github.com/seata/seata/pull/5194)] fix wrong keyword order for oracle when creating a table - [[#5021](https://github.com/seata/seata/pull/5201)] Fix JDK Reflection for Spring origin proxy failed in JDK17 -- [[#5224](https://github.com/seata/seata/pull/5224)] fix oracle initialize script index_name is duplicate -- [[#5464](https://github.com/seata/seata/pull/5464)] fix global session is always begin in saga mode - [[#5023](https://github.com/seata/seata/pull/5203)] Fix `seata-core` dependency transitive conflict in `seata-dubbo` - [[#5224](https://github.com/seata/seata/pull/5224)] fix oracle initialize script index_name is duplicate - [[#5233](https://github.com/seata/seata/pull/5233)] fix the inconsistent configuration item names related to LoadBalance - [[#5245](https://github.com/seata/seata/pull/5245)] fix the incomplete dependency of distribution module - [[#5239](https://github.com/seata/seata/pull/5239)] fix `getConfig` throw `ClassCastException` when use JDK proxy +- [[#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 @@ -43,6 +42,7 @@ Thanks to these contributors for their code commits. Please report an unintended - [Bughue](https://github.com/Bughue) - [pengten](https://github.com/pengten) - [wangliang181230](https://github.com/wangliang181230) +- [tuwenlin](https://github.com/tuwenlin) Also, we receive many valuable issues, questions and advices from our community. Thanks for you all. diff --git a/changes/zh-cn/develop.md b/changes/zh-cn/develop.md index 42cad9e3878..5fd32d1c172 100644 --- a/changes/zh-cn/develop.md +++ b/changes/zh-cn/develop.md @@ -36,5 +36,13 @@ - [xssdpgy](https://github.com/xssdpgy) - [albumenj](https://github.com/albumenj) - [PeppaO](https://github.com/PeppaO) +- [yuruixin](https://github.com/yuruixin) +- [CrazyLionLi](https://github.com/JavaLionLi) +- [xingfudeshi](https://github.com/xingfudeshi) +- [Bughue](https://github.com/Bughue) +- [pengten](https://github.com/pengten) +- [wangliang181230](https://github.com/wangliang181230) +- [tuwenlin](https://github.com/tuwenlin) + 同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。 From edc8d0ffc5811daad954959108767e154c57087e Mon Sep 17 00:00:00 2001 From: tuwenlin Date: Thu, 23 Mar 2023 09:18:44 +0800 Subject: [PATCH 4/4] change pr to 2.0.0 --- changes/en-us/2.0.0.md | 2 ++ changes/en-us/develop.md | 2 -- changes/zh-cn/2.0.0.md | 2 ++ changes/zh-cn/develop.md | 2 -- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/changes/en-us/2.0.0.md b/changes/en-us/2.0.0.md index d4b5b0646a5..58a0124c160 100644 --- a/changes/en-us/2.0.0.md +++ b/changes/en-us/2.0.0.md @@ -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 @@ -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. diff --git a/changes/en-us/develop.md b/changes/en-us/develop.md index 82a65cfcacf..af224973635 100644 --- a/changes/en-us/develop.md +++ b/changes/en-us/develop.md @@ -13,7 +13,6 @@ Add changes here for all PR submitted to the develop branch. - [[#5233](https://github.com/seata/seata/pull/5233)] fix the inconsistent configuration item names related to LoadBalance - [[#5245](https://github.com/seata/seata/pull/5245)] fix the incomplete dependency of distribution module - [[#5239](https://github.com/seata/seata/pull/5239)] fix `getConfig` throw `ClassCastException` when use JDK proxy -- [[#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 @@ -42,7 +41,6 @@ Thanks to these contributors for their code commits. Please report an unintended - [Bughue](https://github.com/Bughue) - [pengten](https://github.com/pengten) - [wangliang181230](https://github.com/wangliang181230) -- [tuwenlin](https://github.com/tuwenlin) Also, we receive many valuable issues, questions and advices from our community. Thanks for you all. diff --git a/changes/zh-cn/2.0.0.md b/changes/zh-cn/2.0.0.md index d0df924ec6a..1f9ec99688d 100644 --- a/changes/zh-cn/2.0.0.md +++ b/changes/zh-cn/2.0.0.md @@ -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)] 修复一些安全漏洞的版本 @@ -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和建议,非常感谢大家。 diff --git a/changes/zh-cn/develop.md b/changes/zh-cn/develop.md index 5fd32d1c172..2d91a3337d7 100644 --- a/changes/zh-cn/develop.md +++ b/changes/zh-cn/develop.md @@ -13,7 +13,6 @@ - [[#5233](https://github.com/seata/seata/pull/5233)] 修复LoadBalance相关配置不一致的问题 - [[#5245](https://github.com/seata/seata/pull/5245)] 修复不完整的distribution模块依赖 - [[#5239](https://github.com/seata/seata/pull/5239)] 修复当使用JDK代理时,`getConfig` 方法获取部分配置时抛出 `ClassCastException` 异常的问题 -- [[#5464](https://github.com/seata/seata/pull/5464)] 修复saga模式全局事务状态始终为Begin的问题 ### optimize: - [[#5208](https://github.com/seata/seata/pull/5208)] 优化多次重复获取Throwable#getCause问题 @@ -42,7 +41,6 @@ - [Bughue](https://github.com/Bughue) - [pengten](https://github.com/pengten) - [wangliang181230](https://github.com/wangliang181230) -- [tuwenlin](https://github.com/tuwenlin) 同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。