Skip to content

Commit

Permalink
bugfix:
Browse files Browse the repository at this point in the history
1. Correct the comment on MySQLUndoUpdateExecutor#UPDATE_SQL_TEMPLATE (apache#5297)
2. Do not remove GlobalSession when retry rollback or retry commit timeout (apache#5293)
  • Loading branch information
ZhangShiYeChina committed Feb 3, 2023
1 parent 0112719 commit d86f6d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
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 =?
*/
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 @@ -379,9 +379,6 @@ protected void handleRetryRollbacking() {
if (ROLLBACK_RETRY_TIMEOUT_UNLOCK_ENABLE) {
rollbackingSession.clean();
}
// Prevent thread safety issues
SessionHolder.getRootSessionManager().removeGlobalSession(rollbackingSession);
LOGGER.error("Global transaction rollback retry timeout and has removed [{}]", rollbackingSession.getXid());

SessionHelper.endRollbackFailed(rollbackingSession, true, true);

Expand Down Expand Up @@ -416,9 +413,6 @@ protected void handleRetryCommitting() {
return;
}
if (isRetryTimeout(now, MAX_COMMIT_RETRY_TIMEOUT, committingSession.getBeginTime())) {
// Prevent thread safety issues
SessionHolder.getRootSessionManager().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

0 comments on commit d86f6d2

Please sign in to comment.