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

optimize: reduce the db and network request when undoLog or lockKey is empty #2409

Merged
merged 28 commits into from
Apr 14, 2020
Merged

optimize: reduce the db and network request when undoLog or lockKey is empty #2409

merged 28 commits into from
Apr 14, 2020

Conversation

lightClouds917
Copy link
Contributor

@lightClouds917 lightClouds917 commented Mar 16, 2020

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

issue
optimize: unnecessary to register branch transaction when undo is empty

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@slievrly slievrly added the Do Not Merge Do not merge into develop label Mar 16, 2020
@lightClouds917 lightClouds917 changed the title optimize:optimize useless branch register WIP:optimize:optimize useless branch register Mar 16, 2020
@slievrly slievrly changed the title WIP:optimize:optimize useless branch register [WIP]:optimize:optimize useless branch register Mar 18, 2020
@codecov-io
Copy link

codecov-io commented Mar 26, 2020

Codecov Report

Merging #2409 into develop will decrease coverage by 0.40%.
The diff coverage is 5.88%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2409      +/-   ##
=============================================
- Coverage      51.48%   51.08%   -0.41%     
+ Complexity      2803     2769      -34     
=============================================
  Files            553      550       -3     
  Lines          17685    17530     -155     
  Branches        2088     2062      -26     
=============================================
- Hits            9105     8955     -150     
- Misses          7727     7733       +6     
+ Partials         853      842      -11     
Impacted Files Coverage Δ Complexity Δ
...java/io/seata/server/coordinator/AbstractCore.java 55.95% <ø> (ø) 12.00 <0.00> (ø)
...n/java/io/seata/rm/datasource/ConnectionProxy.java 26.19% <5.88%> (-1.09%) 13.00 <1.00> (ø)
.../rm/datasource/exec/BaseTransactionalExecutor.java 48.48% <0.00%> (-16.90%) 19.00% <0.00%> (-4.00%)
...io/seata/rm/tcc/interceptor/ActionContextUtil.java 54.54% <0.00%> (-7.53%) 5.00% <0.00%> (ø%)
...ta/rm/datasource/exec/AbstractDMLBaseExecutor.java 75.67% <0.00%> (-1.25%) 7.00% <0.00%> (-1.00%)
...java/io/seata/rm/datasource/ConnectionContext.java 65.21% <0.00%> (ø) 18.00% <0.00%> (+1.00%)
.../io/seata/rm/datasource/sql/SQLVisitorFactory.java 80.00% <0.00%> (ø) 2.00% <0.00%> (ø%)
...ser/druid/DruidDelegatingSQLRecognizerFactory.java 84.61% <0.00%> (ø) 3.00% <0.00%> (ø%)
.../seata/rm/datasource/exec/MultiDeleteExecutor.java
...ava/io/seata/rm/datasource/exec/MultiExecutor.java
... and 6 more

@lightClouds917 lightClouds917 changed the title [WIP]:optimize:optimize useless branch register optimize:optimize useless branch register Mar 26, 2020
@slievrly slievrly removed the Do Not Merge Do not merge into develop label Mar 26, 2020
@lightClouds917
Copy link
Contributor Author

@zjinlei PTAL,THS

@zjinlei zjinlei added this to the 1.2.0 milestone Apr 10, 2020
if (context.hasUndoLog()) {
if (context.hasUndoLog()) {
try {
register();
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to put it in registers and flushUndoLogs.
if there is no undolog why flushUndoLogs method execution without judgment

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 have finish it.PTAL

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

@lightClouds917 lightClouds917 changed the title optimize:optimize useless branch register optimize:Reduce the db and network request when undoLog or lockKey is empty Apr 14, 2020
@slievrly slievrly changed the title optimize:Reduce the db and network request when undoLog or lockKey is empty optimize: reduce the db and network request when undoLog or lockKey is empty Apr 14, 2020
@slievrly slievrly merged commit ec91140 into apache:develop Apr 14, 2020
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

7 participants