diff --git a/changes/1.5.0.md b/changes/1.5.0.md index 136ccc34070bfebf1d65be7538f7ceee7c4f8937..03d86df61fbce64ab0af4bc73dc5f0c49f93e172 100644 --- a/changes/1.5.0.md +++ b/changes/1.5.0.md @@ -43,6 +43,8 @@ Seata 鏄竴娆惧紑婧愮殑鍒嗗竷寮忎簨鍔¤В鍐虫柟妗堬紝鎻愪緵楂樻€ц兘鍜岀畝鍗� - [[#3481](https://github.com/seata/seata/pull/3481)] 淇褰� consul client 鑾峰彇闆嗙兢淇℃伅鎶ラ敊鏃朵細瀵艰嚧鍒锋柊浠诲姟涓柇 - [[#3491](https://github.com/seata/seata/pull/3491)] 淇README.md鏂囦欢涓殑鎷煎啓閿欒 - [[#3531](https://github.com/seata/seata/pull/3531)] 淇RedisTransactionStoreManager璇诲彇brachTransaction涓殑NPE + - [[#3500](https://github.com/seata/seata/pull/3500)] 淇 oracle 鍜� postgreSql 涓嶈兘鏌ヨ鍑� column info 鐨勯棶棰� + - [[#3560](https://github.com/seata/seata/pull/3560)] 淇 Committing 鐘舵€佺殑浜嬪姟娌℃湁鏃堕棿闃堝€奸棶棰� - [[#3555](https://github.com/seata/seata/pull/3555)] 閫氳繃setBytes浠f浛setBlob锛岄伩鍏嶉珮鐗堟湰jdbc椹卞姩宸ヤ綔寮傚父 - [[#3540](https://github.com/seata/seata/pull/3540)] 淇server鍙戝竷鎵撳寘鏃剁己澶辨枃浠� @@ -106,6 +108,7 @@ Seata 鏄竴娆惧紑婧愮殑鍒嗗竷寮忎簨鍔¤В鍐虫柟妗堬紝鎻愪緵楂樻€ц兘鍜岀畝鍗� - [github-ganyu](https://github.com/github-ganyu) - [xuande](https://github.com/xuande) - [tanggen](https://github.com/tanggen) + - [dmego](https://github.com/dmego) 鍚屾椂锛屾垜浠敹鍒颁簡绀惧尯鍙嶉鐨勫緢澶氭湁浠峰€肩殑issue鍜屽缓璁紝闈炲父鎰熻阿澶у銆� diff --git a/changes/en-us/1.5.0.md b/changes/en-us/1.5.0.md index 8232bc5273ecbd8fceb993d340f9f3bd2f95eded..9e2e0c202009dfacc346652a282e034571997cfb 100644 --- a/changes/en-us/1.5.0.md +++ b/changes/en-us/1.5.0.md @@ -44,6 +44,8 @@ - [[#3481](https://github.com/seata/seata/pull/3481)] fix seata node refresh failure because consul crash - [[#3491](https://github.com/seata/seata/pull/3491)] fix typo in README.md - [[#3531](https://github.com/seata/seata/pull/3531)] fix the NPE of RedisTransactionStoreManager when get branch transactions + - [[#3500](https://github.com/seata/seata/pull/3500)] fix oracle and postgreSQL can't query column info + - [[#3560](https://github.com/seata/seata/pull/3560)] set time threshold for transactions in committing state - [[#3555](https://github.com/seata/seata/pull/3555)] do not call setBlob to invalid the jdbc exception - [[#3540](https://github.com/seata/seata/pull/3540)] fix server distribution missing files @@ -110,6 +112,7 @@ - [github-ganyu](https://github.com/github-ganyu) - [xuande](https://github.com/xuande) - [tanggen](https://github.com/tanggen) + - [dmego](https://github.com/dmego) Also, we receive many valuable issues, questions and advices from our community. Thanks for you all. 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 7f289cb03c233987fe32eb1e678a33a1a2c12cbd..929a5a462192ee32a882e0f52ba2cf820e607a98 100644 --- a/server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java +++ b/server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java @@ -281,7 +281,7 @@ public class DefaultCoordinator extends AbstractTCInboundHandler implements Tran SessionHelper.forEach(rollbackingSessions, rollbackingSession -> { try { // prevent repeated rollback - if (rollbackingSession.getStatus().equals(GlobalStatus.Rollbacking) && !rollbackingSession.isRollbackingDead()) { + if (rollbackingSession.getStatus().equals(GlobalStatus.Rollbacking) && !rollbackingSession.isDeadSession()) { //The function of this 'return' is 'continue'. return; } @@ -316,6 +316,11 @@ public class DefaultCoordinator extends AbstractTCInboundHandler implements Tran long now = System.currentTimeMillis(); SessionHelper.forEach(committingSessions, committingSession -> { try { + // prevent repeated commit + if (committingSession.getStatus().equals(GlobalStatus.Committing) && !committingSession.isDeadSession()) { + //The function of this 'return' is 'continue'. + return; + } if (isRetryTimeout(now, MAX_COMMIT_RETRY_TIMEOUT.toMillis(), committingSession.getBeginTime())) { /** * Prevent thread safety issues diff --git a/server/src/main/java/io/seata/server/session/GlobalSession.java b/server/src/main/java/io/seata/server/session/GlobalSession.java index 02b8a93a62a5cb1153bea46aaa61cebe1ef8d7d3..d673ced261987f3d53ccc1e672c41968ffa442cf 100644 --- a/server/src/main/java/io/seata/server/session/GlobalSession.java +++ b/server/src/main/java/io/seata/server/session/GlobalSession.java @@ -157,10 +157,10 @@ public class GlobalSession implements SessionLifecycle, SessionStorable { } /** - * prevent could not handle rollbacking transaction - * @return if true force roll back + * prevent could not handle committing and rollbacking transaction + * @return if true retry commit or roll back */ - public boolean isRollbackingDead() { + public boolean isDeadSession() { return (System.currentTimeMillis() - beginTime) > (2 * 6000); } diff --git a/server/src/main/java/io/seata/server/storage/db/session/DataBaseSessionManager.java b/server/src/main/java/io/seata/server/storage/db/session/DataBaseSessionManager.java index 5f3faf5c740da2ea95e5fdf48285dc7dabb2746f..f05cf1f280886d098d2ec9757004776b49448f27 100644 --- a/server/src/main/java/io/seata/server/storage/db/session/DataBaseSessionManager.java +++ b/server/src/main/java/io/seata/server/storage/db/session/DataBaseSessionManager.java @@ -168,7 +168,7 @@ public class DataBaseSessionManager extends AbstractSessionManager if (SessionHolder.ASYNC_COMMITTING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) { return findGlobalSessions(new SessionCondition(GlobalStatus.AsyncCommitting)); } else if (SessionHolder.RETRY_COMMITTING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) { - return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.CommitRetrying})); + return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.CommitRetrying, GlobalStatus.Committing})); } else if (SessionHolder.RETRY_ROLLBACKING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) { return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.RollbackRetrying, GlobalStatus.Rollbacking, GlobalStatus.TimeoutRollbacking, GlobalStatus.TimeoutRollbackRetrying})); diff --git a/server/src/main/java/io/seata/server/storage/redis/session/RedisSessionManager.java b/server/src/main/java/io/seata/server/storage/redis/session/RedisSessionManager.java index 63bc5d9c8191698926d778f9dc7ee23bae0bdaa6..ef66306037ce3814936600d5eaee75ab90bca23a 100644 --- a/server/src/main/java/io/seata/server/storage/redis/session/RedisSessionManager.java +++ b/server/src/main/java/io/seata/server/storage/redis/session/RedisSessionManager.java @@ -166,7 +166,7 @@ public class RedisSessionManager extends AbstractSessionManager if (SessionHolder.ASYNC_COMMITTING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) { return findGlobalSessions(new SessionCondition(GlobalStatus.AsyncCommitting)); } else if (SessionHolder.RETRY_COMMITTING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) { - return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.CommitRetrying})); + return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.CommitRetrying, GlobalStatus.Committing})); } else if (SessionHolder.RETRY_ROLLBACKING_SESSION_MANAGER_NAME.equalsIgnoreCase(taskName)) { return findGlobalSessions(new SessionCondition(new GlobalStatus[] {GlobalStatus.RollbackRetrying, GlobalStatus.Rollbacking, GlobalStatus.TimeoutRollbacking, GlobalStatus.TimeoutRollbackRetrying}));