Skip to content

Conversation

simzyoo
Copy link
Contributor

@simzyoo simzyoo commented Jun 27, 2025

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

1.Added a check for the GlobalStatus.TimeoutRollbacking state to decide whether to enter the retry queue during rollback.

Ⅱ. Does this pull request fix one issue?

fixes #7470

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Copy link

codecov bot commented Jun 27, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 60.73%. Comparing base (88bba2f) to head (779ee6b).
⚠️ Report is 14 commits behind head on 2.x.

Files with missing lines Patch % Lines
...org/apache/seata/server/session/GlobalSession.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #7480      +/-   ##
============================================
+ Coverage     60.49%   60.73%   +0.24%     
- Complexity      656      658       +2     
============================================
  Files          1298     1298              
  Lines         49081    49079       -2     
  Branches       5771     5769       -2     
============================================
+ Hits          29691    29809     +118     
+ Misses        16757    16631     -126     
- Partials       2633     2639       +6     
Files with missing lines Coverage Δ
...g/apache/seata/server/coordinator/DefaultCore.java 49.38% <100.00%> (+3.26%) ⬆️
...org/apache/seata/server/session/GlobalSession.java 70.84% <0.00%> (+2.03%) ⬆️

... and 16 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ex.getMessage()
});
if (!retrying) {
if (shouldQueueToRetryRollback(retrying, globalSession)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not directly remove this retrying check? Then handle the transaction state transition in the queueToRetryRollback method instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not directly remove this retrying check? Then handle the transaction state transition in the queueToRetryRollback method instead?

Does it mean moving the logic of shouldQueueToRetryRollback(retrying, globalSession) into globalSession.queueToRetryRollback()?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not directly remove this retrying check? Then handle the transaction state transition in the queueToRetryRollback method instead?

Does it mean moving the logic of shouldQueueToRetryRollback(retrying, globalSession) into globalSession.queueToRetryRollback()?

Yes, because regardless of whether it is in a retry state or not, the transaction always transitions from state A to a substate of A, such as Committing. If the transaction in this state fails, the state will change to CommitRetry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not directly remove this retrying check? Then handle the transaction state transition in the queueToRetryRollback method instead?

Does it mean moving the logic of shouldQueueToRetryRollback(retrying, globalSession) into globalSession.queueToRetryRollback()?

Yes, because regardless of whether it is in a retry state or not, the transaction always transitions from state A to a substate of A, such as Committing. If the transaction in this state fails, the state will change to CommitRetry.

Ok,is it like this?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@funky-eyes 这里辛苦再帮忙看看

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not directly remove this retrying check? Then handle the transaction state transition in the queueToRetryRollback method instead?

Does it mean moving the logic of shouldQueueToRetryRollback(retrying, globalSession) into globalSession.queueToRetryRollback()?

Yes, because regardless of whether it is in a retry state or not, the transaction always transitions from state A to a substate of A, such as Committing. If the transaction in this state fails, the state will change to CommitRetry.

Ok,is it like this?

image

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not directly remove this retrying check? Then handle the transaction state transition in the queueToRetryRollback method instead?

Does it mean moving the logic of shouldQueueToRetryRollback(retrying, globalSession) into globalSession.queueToRetryRollback()?

Yes, because regardless of whether it is in a retry state or not, the transaction always transitions from state A to a substate of A, such as Committing. If the transaction in this state fails, the state will change to CommitRetry.

Ok,is it like this?
image

yes

done

liangzaiwei added 6 commits July 6, 2025 22:49
liangzaiwei added 2 commits July 18, 2025 11:11
…k-retrying-status

# Conflicts:
#	changes/en-us/2.x.md
#	changes/zh-cn/2.x.md
@funky-eyes
Copy link
Contributor

This branch has conflicts that must be resolved
Use the web editor or the command line to resolve conflicts before continuing.

changes/en-us/2.x.md
changes/zh-cn/2.x.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

全局事务状态似乎永远无法进入到TimeoutRollbackRetrying
2 participants