-
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: Improve the performance of global commit and global rollback #4270
Conversation
异步删除globalsession目前已经实现了(rollback下异步删除已经有pr),当同步二阶段完成的时候,end是通过retrycommit/retryrollback的定时线程去删除的,已经避免了changestatus和delete lock和delete globalsession的情况。 |
|
@a364176773 我理解是不是应该这样做:
至于幂等问题,需要业务方自行保证。 |
发起后是tc重试,不是tm,做异步删除,我好像没说不做吧 |
执行完一个branch直接异步删即可 |
8d4713a
to
d7bb4a1
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4270 +/- ##
=============================================
- Coverage 48.54% 48.52% -0.03%
- Complexity 3793 3798 +5
=============================================
Files 724 725 +1
Lines 24240 24305 +65
Branches 2971 2984 +13
=============================================
+ Hits 11768 11794 +26
- Misses 11230 11261 +31
- Partials 1242 1250 +8
|
server/src/main/java/io/seata/server/session/SessionHelper.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/session/SessionHelper.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/session/SessionHelper.java
Outdated
Show resolved
Hide resolved
...ain/java/io/seata/spring/boot/autoconfigure/properties/server/session/SessionProperties.java
Show resolved
Hide resolved
server/src/main/java/io/seata/server/session/SessionHelper.java
Outdated
Show resolved
Hide resolved
f5948f7
to
5c674db
Compare
@a364176773 done |
...ain/java/io/seata/spring/boot/autoconfigure/properties/server/session/SessionProperties.java
Show resolved
Hide resolved
server/src/main/java/io/seata/server/session/SessionHelper.java
Outdated
Show resolved
Hide resolved
cfe8ee5
to
ab08e2b
Compare
server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.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 补充一下change log,在changes文件夹里有中英两版1.5.0.md文件,补充pr信息和作者信息
已补充pr信息,作者信息之前已有。 |
server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java
Show resolved
Hide resolved
server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/coordinator/DefaultCoordinator.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
*/ | ||
private static final Configuration CONFIG = ConfigurationFactory.getInstance(); | ||
|
||
private static final Boolean ENABLE_BRANCH_ASYNC_REMOVE = CONFIG.getBoolean( |
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.
default value should be false.
Ⅰ. Describe what this PR did
When the global commit or rollback is performed, the branch transaction enters the thread pool for asynchronous deletion after the second-phase delivery is successful.
全局提交或回滚时,分支事务二阶段下发成功后进入线程池中异步删除。
Ⅱ. Does this pull request fix one issue?
fixes #3750
Ⅲ. Why don't you add test cases (unit test/integration test)?
先review方案
Ⅳ. Describe how to verify it
The transaction is committed and rolled back normally, the TM receives the response before the branch transaction is deleted, and the branch transaction is deleted after the asynchronous thread is executed.
正常提交和回滚事务,TM在分支事务删除前收到响应,异步线程执行后分支事务被删除。
Ⅴ. Special notes for reviews