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: fix repeated rollback caused by asynchronous rollback thread #2059

Merged
merged 8 commits into from
Dec 19, 2019

Conversation

l81893521
Copy link
Contributor

Ⅰ. Describe what this PR did

schedule retry rollback thread pool cause repeated rollback

Ⅱ. Does this pull request fix one issue?

#2058

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Dec 18, 2019

Codecov Report

Merging #2059 into develop will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2059      +/-   ##
=============================================
- Coverage      55.32%   55.31%   -0.02%     
+ Complexity      2524     2523       -1     
=============================================
  Files            446      446              
  Lines          14910    14913       +3     
  Branches        1765     1766       +1     
=============================================
  Hits            8249     8249              
- Misses          5899     5900       +1     
- Partials         762      764       +2
Impacted Files Coverage Δ Complexity Δ
...o/seata/server/coordinator/DefaultCoordinator.java 47.63% <0%> (-0.78%) 27 <0> (-1)
...in/java/io/seata/server/session/GlobalSession.java 84.13% <0%> (-0.89%) 67 <0> (-1)
...server/store/file/FileTransactionStoreManager.java 57.14% <0%> (+0.63%) 30% <0%> (+1%) ⬆️

@@ -381,6 +381,10 @@ protected void handleRetryRollbacking() {
long now = System.currentTimeMillis();
for (GlobalSession rollbackingSession : rollbackingSessions) {
try {
//prevent repeated rollback
if (rollbackingSession.getStatus().equals(GlobalStatus.Rollbacking) && !rollbackingSession.isTimeout()) {
Copy link
Member

Choose a reason for hiding this comment

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

if throw RunTimeException it will no longer rollback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it will keep rollback

* @return if true force roll back
*/
public boolean isRollbackingDead() {
return (System.currentTimeMillis() - beginTime) > (3 * 6000);
Copy link
Contributor

Choose a reason for hiding this comment

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

(System.currentTimeMillis() - beginTime) > (3 * 6000 + timeout);
Suggested overload isTimeout()

Copy link
Contributor

Choose a reason for hiding this comment

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

My mistake, you are right!

Copy link
Contributor

@zjinlei zjinlei left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM,temporary solution to solve concurrent rollback and retry concurrent operations and rollback after restart.

@slievrly slievrly added this to the 1.0 milestone Dec 19, 2019
@slievrly slievrly changed the title bugfix: fix repeated rollback by schedule retry rollback retry thread pool bugfix: fix repeated rollback caused by asynchronous rollback thread Dec 19, 2019
@slievrly slievrly merged commit 6fd8021 into develop Dec 19, 2019
@slievrly slievrly deleted the fix_repeated_rollback branch December 31, 2019 07:22
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.

None yet

5 participants