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 4 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/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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问题
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