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: treating a unique index conflict during rollback as a dirty write #7135

Merged
merged 7 commits into from
Feb 6, 2025

Conversation

YongGoose
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

fixes #6561

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@funky-eyes funky-eyes added first-time contributor first-time contributor module/rm-datasource rm-datasource module labels Feb 5, 2025
@funky-eyes funky-eyes added this to the 2.4.0 milestone Feb 5, 2025
@@ -400,6 +400,8 @@ public void undo(DataSourceProxy dataSourceProxy, String xid, long branchId) thr
if (LOGGER.isInfoEnabled()) {
LOGGER.info("xid {} branch {}, undo_log inserted, retry rollback", xid, branchId);
}
throw new BranchTransactionException(BranchRollbackFailed_Unretriable, String.format(
Copy link
Contributor

Choose a reason for hiding this comment

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

It should not be written here; the exception handling should be done in undoExecutor.executeOn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 45a151d !

PTAL 🙂

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 52.03%. Comparing base (86029bb) to head (196f218).
Report is 1 commits behind head on 2.x.

Files with missing lines Patch % Lines
...ata/rm/datasource/undo/AbstractUndoLogManager.java 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##                2.x    #7135   +/-   ##
=========================================
  Coverage     52.02%   52.03%           
+ Complexity     6711     6708    -3     
=========================================
  Files          1145     1145           
  Lines         40559    40562    +3     
  Branches       4737     4737           
=========================================
+ Hits          21102    21106    +4     
+ Misses        17473    17470    -3     
- Partials       1984     1986    +2     
Files with missing lines Coverage Δ
...ata/rm/datasource/undo/AbstractUndoLogManager.java 52.26% <0.00%> (-0.66%) ⬇️

... and 5 files with indirect coverage changes

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

@YongGoose
Copy link
Contributor Author

Please register your PR in those two files : https://github.com/apache/incubator-seata/blob/2.x/changes/zh-cn/2.x.md https://github.com/apache/incubator-seata/blob/2.x/changes/en-us/2.x.md

Done in fb2eaf2 !

Please check if the Chinese translation is correct.

@funky-eyes funky-eyes changed the title Catch SQLIntegrityConstraintViolationException and handle rollback bugfix: treating a unique index conflict during rollback as a dirty write Feb 6, 2025
YongGoose and others added 2 commits February 6, 2025 10:52
Co-authored-by: funkye <364176773@qq.com>
Co-authored-by: funkye <364176773@qq.com>
@YongGoose YongGoose requested a review from funky-eyes February 6, 2025 04:54
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make sure your Github ID is in the list below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

Done it 196f218 !

Copy link
Contributor

Choose a reason for hiding this comment

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

Please make sure your Github ID is in the list below

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

@funky-eyes funky-eyes merged commit 67548df into apache:2.x Feb 6, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor module/rm-datasource rm-datasource module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when doing global rollback ,may cause an endless loop
2 participants