-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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: xa resource suspension #4228
Conversation
# Conflicts: # common/src/main/java/io/seata/common/DefaultValues.java # core/src/main/java/io/seata/core/constants/ConfigurationKeys.java
server/src/main/java/io/seata/server/coordinator/DefaultCore.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/xa/RmNettyClientTimeoutCheckerHookXA.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/xa/RmNettyClientTimeoutCheckerHookXA.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/xa/ConnectionProxyXA.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/transaction/xa/XACore.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/transaction/xa/XACore.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## develop #4228 +/- ##
=============================================
- Coverage 49.27% 49.26% -0.02%
- Complexity 4068 4071 +3
=============================================
Files 731 731
Lines 25370 25462 +92
Branches 3146 3156 +10
=============================================
+ Hits 12501 12543 +42
- Misses 11539 11583 +44
- Partials 1330 1336 +6
|
rm-datasource/src/main/java/io/seata/rm/BaseDataSourceResource.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/xa/ConnectionProxyXA.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/xa/ConnectionProxyXA.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/xa/ResourceManagerXA.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/xa/ResourceManagerXA.java
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
# Conflicts: # changes/1.5.0.md # changes/en-us/1.5.0.md # common/src/main/java/io/seata/common/DefaultValues.java # core/src/main/java/io/seata/core/constants/ConfigurationKeys.java # seata-spring-autoconfigure/seata-spring-autoconfigure-client/src/main/java/io/seata/spring/boot/autoconfigure/properties/client/RmProperties.java
@slievrly PTAL |
# Conflicts: # changes/1.5.0.md # changes/en-us/1.5.0.md # core/src/main/java/io/seata/core/constants/ConfigurationKeys.java
...rc/main/java/io/seata/serializer/seata/protocol/transaction/BranchRegisterResponseCodec.java
Outdated
Show resolved
Hide resolved
# Conflicts: # changes/1.5.0.md # common/src/main/java/io/seata/common/ConfigurationKeys.java
@@ -185,6 +204,12 @@ public synchronized void commit() throws SQLException { | |||
try { | |||
end(XAResource.TMSUCCESS); | |||
xaResource.prepare(xaBranchXid); | |||
long now = System.currentTimeMillis(); |
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.
The timeout calculation should not include the time when the database executes XA prepare. Xa prepare is a time-consuming operation. if the branch timeout can be executed directly xa rollback without the need for xa prepare.
超时计算不应该包含数据库prepare的时间,xa prepare 是一个耗时代价比较高的操作,如果分支超时可以直接xa rollback 而不需要 xa prepare.
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.
done
All configuration items need to be included in the following locations: |
… fix_xa_resource_suspension
@@ -49,7 +57,13 @@ | |||
private volatile boolean kept = false; | |||
|
|||
private volatile boolean rollBacked = false; | |||
|
|||
|
|||
private volatile Long branchRegisterTime = null; |
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.
why do these transaction contexts not need to be cleaned up when close?
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
修复xa模式获取channel导致的资源悬挂问题
Ⅱ. Does this pull request fix one issue?
fixed #4138
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews