Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: don't remove GlobalSession when retry rollback or retry commit timeout #5299

Merged
merged 5 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changes/en-us/1.6.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions changes/zh-cn/1.6.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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文件中的配置项格式
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

强迫症表示,等号后面加个空格吧。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be fix in the next pr.

*/
private static final String UPDATE_SQL_TEMPLATE = "UPDATE %s SET %s WHERE %s ";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down