-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
optimize: optimize transaction context switch logic when transaction mode switching #2307
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2307 +/- ##
=============================================
+ Coverage 51.78% 51.83% +0.04%
- Complexity 2698 2701 +3
=============================================
Files 517 517
Lines 16767 16776 +9
Branches 2034 2033 -1
=============================================
+ Hits 8683 8695 +12
+ Misses 7275 7271 -4
- Partials 809 810 +1 |
return false; | ||
} | ||
|
||
if (RootContext.inGlobalTransaction() && !RootContext.getBranchType().equals(String.valueOf(BranchType.AT.ordinal()))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughtful point
...aga-engine-store/src/main/java/io/seata/saga/engine/store/db/DbAndReportTcStateLogStore.java
Outdated
Show resolved
Hide resolved
spring/src/main/java/io/seata/spring/annotation/GlobalTransactional.java
Outdated
Show resolved
Hide resolved
tm/src/main/java/io/seata/tm/api/transaction/TransactionInfo.java
Outdated
Show resolved
Hide resolved
@q294881866 PTAL tcc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大部分代码是 tx-xid-interceptor-type 改成了根据 BranchType 来处理,确保新的属性生效即可。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remain neutral cause I think when begin transaction need branch type for figure out tcc interceptor problem. Just a little bit wired. But I could not find a better way :).
rm-datasource/src/main/java/io/seata/rm/datasource/exec/ExecuteTemplate.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
Optimize transaction context behavior when transaction mode is switched:
1.remove interceptorType context variable.
2.add branchType context variable and use it to distinguish different branch transaction modes.(distinguish TCC Mode and AT Mode)
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews