From ec205e128777842cfcf0d06953295eee68c7e799 Mon Sep 17 00:00:00 2001 From: ZhangShiYeChina Date: Fri, 3 Feb 2023 21:50:43 +0800 Subject: [PATCH 1/4] bugfix: 1. Correct the comment on MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE (#5297) 2. Do not remove GlobalSession when retry rollback or retry commit timeout (#5293) --- .../rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java | 2 +- .../io/seata/server/coordinator/DefaultCoordinator.java | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java b/rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java index 52df100d047..50c59cf6bc5 100644 --- a/rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java +++ b/rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java @@ -37,7 +37,7 @@ public class MySQLUndoUpdateExecutor extends AbstractUndoExecutor { /** - * UPDATE a SET x = ?, y = ?, z = ? WHERE pk1 in (?) pk2 in (?) + * UPDATE a SET x = ?, y = ?, z = ? WHERE pk1 =? and pk2 =? */ private static final String UPDATE_SQL_TEMPLATE = "UPDATE %s SET %s WHERE %s "; diff --git a/server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java b/server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java index 75c09ac2d2a..b1f41d64436 100644 --- a/server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java +++ b/server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java @@ -383,9 +383,6 @@ protected void handleRetryRollbacking() { if (ROLLBACK_RETRY_TIMEOUT_UNLOCK_ENABLE) { rollbackingSession.clean(); } - // Prevent thread safety issues - SessionHolder.getRetryRollbackingSessionManager().removeGlobalSession(rollbackingSession); - LOGGER.error("Global transaction rollback retry timeout and has removed [{}]", rollbackingSession.getXid()); SessionHelper.endRollbackFailed(rollbackingSession, true, true); @@ -421,9 +418,6 @@ protected void handleRetryCommitting() { return; } if (isRetryTimeout(now, MAX_COMMIT_RETRY_TIMEOUT, committingSession.getBeginTime())) { - // Prevent thread safety issues - SessionHolder.getRetryCommittingSessionManager().removeGlobalSession(committingSession); - LOGGER.error("Global transaction commit retry timeout and has removed [{}]", committingSession.getXid()); // commit retry timeout event SessionHelper.endCommitFailed(committingSession, true, true); From 68a315192524b22ec774f8ba40f7d362e893c5ad Mon Sep 17 00:00:00 2001 From: ZhangShiYeChina Date: Sat, 4 Feb 2023 14:06:25 +0800 Subject: [PATCH 2/4] bugfix: 1. update change log --- changes/en-us/1.6.1.md | 2 ++ changes/en-us/2.0.0.md | 2 ++ changes/zh-cn/1.6.1.md | 2 ++ changes/zh-cn/2.0.0.md | 4 ++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/changes/en-us/1.6.1.md b/changes/en-us/1.6.1.md index 8752dfb9720..a0968c2345f 100644 --- a/changes/en-us/1.6.1.md +++ b/changes/en-us/1.6.1.md @@ -20,6 +20,8 @@ The version is updated as follows: ### bugfix: - [[#5179](https://github.com/seata/seata/pull/5179)] fix ClassNotFoundException when server starts using Eureka +- [[#5297](https://github.com/seata/seata/pull/5297)] Correct the comment on MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE +- [[#5293](https://github.com/seata/seata/pull/5293)] Do not remove GlobalSession when retry rollback or retry commit timeout ### optimize: - [[#5120](https://github.com/seata/seata/pull/5120)] unify the format of configuration items in yml files diff --git a/changes/en-us/2.0.0.md b/changes/en-us/2.0.0.md index 4593f9bae53..f47fef27f83 100644 --- a/changes/en-us/2.0.0.md +++ b/changes/en-us/2.0.0.md @@ -19,6 +19,8 @@ The version is updated as follows: ### bugfix: - [[#1234](https://github.com/seata/seata/pull/1234)] Please delete the sample later + - [[#5297](https://github.com/seata/seata/pull/5297)] Correct the comment on MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE + - [[#5293](https://github.com/seata/seata/pull/5293)] Do not remove GlobalSession when retry rollback or retry commit timeout ### optimize: - [[#1234](https://github.com/seata/seata/pull/1234)] Please delete the sample later diff --git a/changes/zh-cn/1.6.1.md b/changes/zh-cn/1.6.1.md index 23d2dcfde3c..4193ae76a00 100644 --- a/changes/zh-cn/1.6.1.md +++ b/changes/zh-cn/1.6.1.md @@ -20,6 +20,8 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单 ### bugfix: - [[#5179](https://github.com/seata/seata/pull/5179)] 修复使用Eureka作为注册中心ClassNotFoundException问题 +- [[#5297](https://github.com/seata/seata/pull/5297)] 纠正 MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE 的注释 +- [[#5293](https://github.com/seata/seata/pull/5293)] 协调器的定时任务中处理全局事务的重试回滚 或 重试提交,即使超时也不再删除事务 ### optimize: - [[#5120](https://github.com/seata/seata/pull/5120)] 统一yml文件中的配置项格式 diff --git a/changes/zh-cn/2.0.0.md b/changes/zh-cn/2.0.0.md index 591880a4071..735957a0343 100644 --- a/changes/zh-cn/2.0.0.md +++ b/changes/zh-cn/2.0.0.md @@ -18,8 +18,8 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单 - [[#1234](https://github.com/seata/seata/pull/1234)] 样例,后续请删除 ### bugfix: - - [[#1234](https://github.com/seata/seata/pull/1234)] 样例,后续请删除 - + - [[#5297](https://github.com/seata/seata/pull/5297)] 纠正 MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE 的注释 + - [[#5293](https://github.com/seata/seata/pull/5293)] 协调器的定时任务中处理全局事务的重试回滚 或 重试提交,即使超时也不再删除事务 ### optimize: - [[#1234](https://github.com/seata/seata/pull/1234)] 样例,后续请删除 From 7c7ae3e8aeab1ceef6db2b7cdcd1a124d714d308 Mon Sep 17 00:00:00 2001 From: ZhangShiYeChina Date: Sat, 4 Feb 2023 22:00:36 +0800 Subject: [PATCH 3/4] bugfix: 1. update change log --- changes/en-us/2.0.0.md | 2 -- changes/zh-cn/2.0.0.md | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/changes/en-us/2.0.0.md b/changes/en-us/2.0.0.md index f47fef27f83..4593f9bae53 100644 --- a/changes/en-us/2.0.0.md +++ b/changes/en-us/2.0.0.md @@ -19,8 +19,6 @@ The version is updated as follows: ### bugfix: - [[#1234](https://github.com/seata/seata/pull/1234)] Please delete the sample later - - [[#5297](https://github.com/seata/seata/pull/5297)] Correct the comment on MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE - - [[#5293](https://github.com/seata/seata/pull/5293)] Do not remove GlobalSession when retry rollback or retry commit timeout ### optimize: - [[#1234](https://github.com/seata/seata/pull/1234)] Please delete the sample later diff --git a/changes/zh-cn/2.0.0.md b/changes/zh-cn/2.0.0.md index 735957a0343..591880a4071 100644 --- a/changes/zh-cn/2.0.0.md +++ b/changes/zh-cn/2.0.0.md @@ -18,8 +18,8 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单 - [[#1234](https://github.com/seata/seata/pull/1234)] 样例,后续请删除 ### bugfix: - - [[#5297](https://github.com/seata/seata/pull/5297)] 纠正 MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE 的注释 - - [[#5293](https://github.com/seata/seata/pull/5293)] 协调器的定时任务中处理全局事务的重试回滚 或 重试提交,即使超时也不再删除事务 + - [[#1234](https://github.com/seata/seata/pull/1234)] 样例,后续请删除 + ### optimize: - [[#1234](https://github.com/seata/seata/pull/1234)] 样例,后续请删除 From 8eac140a03fa0d2974bc586e5bc30f95a3ca1f7c Mon Sep 17 00:00:00 2001 From: ZhangShiYeChina Date: Mon, 6 Feb 2023 10:58:24 +0800 Subject: [PATCH 4/4] bugfix: 1. update change log --- changes/en-us/1.6.1.md | 2 -- changes/en-us/develop.md | 2 ++ changes/zh-cn/1.6.1.md | 2 -- changes/zh-cn/develop.md | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/changes/en-us/1.6.1.md b/changes/en-us/1.6.1.md index a0968c2345f..8752dfb9720 100644 --- a/changes/en-us/1.6.1.md +++ b/changes/en-us/1.6.1.md @@ -20,8 +20,6 @@ The version is updated as follows: ### bugfix: - [[#5179](https://github.com/seata/seata/pull/5179)] fix ClassNotFoundException when server starts using Eureka -- [[#5297](https://github.com/seata/seata/pull/5297)] Correct the comment on MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE -- [[#5293](https://github.com/seata/seata/pull/5293)] Do not remove GlobalSession when retry rollback or retry commit timeout ### optimize: - [[#5120](https://github.com/seata/seata/pull/5120)] unify the format of configuration items in yml files diff --git a/changes/en-us/develop.md b/changes/en-us/develop.md index 6780d3be941..348ab442505 100644 --- a/changes/en-us/develop.md +++ b/changes/en-us/develop.md @@ -17,6 +17,7 @@ Add changes here for all PR submitted to the develop branch. - [[#5281](https://github.com/seata/seata/pull/5281)] parallel request handle throw IndexOutOfBoundsException - [[#5288](https://github.com/seata/seata/pull/5288)] fix auto-increment of pk columns in Oracle in AT mode - [[#5287](https://github.com/seata/seata/pull/5287)] fix auto-increment of pk columns in PostgreSQL in AT mode +- [[#5299](https://github.com/seata/seata/pull/5299)] fix GlobalSession deletion when retry rollback or retry commit timeout ### optimize: @@ -50,6 +51,7 @@ Thanks to these contributors for their code commits. Please report an unintended - [GoodBoyCoder](https://github.com/GoodBoyCoder) - [a364176773](https://github.com/a364176773) - [isharpever](https://github.com/isharpever) +- [ZhangShiYeChina](https://github.com/ZhangShiYeChina) Also, we receive many valuable issues, questions and advices from our community. Thanks for you all. diff --git a/changes/zh-cn/1.6.1.md b/changes/zh-cn/1.6.1.md index 4193ae76a00..23d2dcfde3c 100644 --- a/changes/zh-cn/1.6.1.md +++ b/changes/zh-cn/1.6.1.md @@ -20,8 +20,6 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单 ### bugfix: - [[#5179](https://github.com/seata/seata/pull/5179)] 修复使用Eureka作为注册中心ClassNotFoundException问题 -- [[#5297](https://github.com/seata/seata/pull/5297)] 纠正 MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE 的注释 -- [[#5293](https://github.com/seata/seata/pull/5293)] 协调器的定时任务中处理全局事务的重试回滚 或 重试提交,即使超时也不再删除事务 ### optimize: - [[#5120](https://github.com/seata/seata/pull/5120)] 统一yml文件中的配置项格式 diff --git a/changes/zh-cn/develop.md b/changes/zh-cn/develop.md index 4091ea8e7ab..831277b1cdf 100644 --- a/changes/zh-cn/develop.md +++ b/changes/zh-cn/develop.md @@ -17,7 +17,7 @@ - [[#5281](https://github.com/seata/seata/pull/5281)] 修复并行rm请求处理时数组索引越界问题 - [[#5288](https://github.com/seata/seata/pull/5288)] 修复AT模式下oracle的主键列自增的问题 - [[#5287](https://github.com/seata/seata/pull/5287)] 修复AT模式下pgsql的主键列自增的问题 - +- [[#5299](https://github.com/seata/seata/pull/5299)] 修复TC端重试回滚或重试提交超时GlobalSession的删除问题 ### optimize: - [[#5208](https://github.com/seata/seata/pull/5208)] 优化多次重复获取Throwable#getCause问题