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 server rpc with db #1823

Merged
merged 16 commits into from
Nov 1, 2019

Conversation

zjinlei
Copy link
Contributor

@zjinlei zjinlei commented Oct 25, 2019

Ⅰ. Describe what this PR did

1.reduce rpc with db when branchRegister and getGolbalStatus
2.reduce rpc with db when batch locks insert

Ⅱ. Does this pull request fix one issue?

fixes #1818

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@zjinlei zjinlei changed the title bugfix: db globalstatus inconsistent optimize: reduce rpc with db Oct 27, 2019
@codecov-io
Copy link

codecov-io commented Oct 27, 2019

Codecov Report

Merging #1823 into develop will decrease coverage by 0.09%.
The diff coverage is 56.89%.

Impacted file tree graph

@@             Coverage Diff              @@
##             develop    #1823     +/-   ##
============================================
- Coverage      54.94%   54.84%   -0.1%     
+ Complexity      2358     2357      -1     
============================================
  Files            422      422             
  Lines          14259    14314     +55     
  Branches        1673     1687     +14     
============================================
+ Hits            7834     7850     +16     
- Misses          5679     5713     +34     
- Partials         746      751      +5
Impacted Files Coverage Δ Complexity Δ
...io/seata/server/store/TransactionStoreManager.java 86.66% <ø> (ø) 0 <0> (ø) ⬇️
.../server/store/AbstractTransactionStoreManager.java 40% <0%> (-10%) 2 <0> (ø)
...java/io/seata/server/AbstractTCInboundHandler.java 1.21% <0%> (ø) 1 <0> (ø) ⬇️
...va/io/seata/core/store/db/LogStoreDataBaseDAO.java 59.47% <100%> (ø) 21 <4> (ø) ⬇️
...eata/server/session/db/DataBaseSessionManager.java 36.2% <100%> (+1.11%) 12 <2> (+1) ⬆️
...in/java/io/seata/server/session/SessionHolder.java 60% <100%> (+0.5%) 17 <2> (+1) ⬆️
...io/seata/server/session/DefaultSessionManager.java 95.45% <100%> (+0.21%) 9 <1> (+1) ⬆️
...rver/store/db/DatabaseTransactionStoreManager.java 66.66% <50%> (-1.03%) 22 <0> (ø)
...a/io/seata/core/store/db/LockStoreDataBaseDAO.java 46.42% <52.5%> (-7.29%) 18 <2> (-2)
.../java/io/seata/server/coordinator/DefaultCore.java 42.68% <75%> (ø) 26 <3> (ø) ⬇️
... and 30 more

@zjinlei zjinlei changed the title optimize: reduce rpc with db optimize: reduce server rpc with db Oct 27, 2019
@zjinlei zjinlei added this to the 1.0 milestone Oct 27, 2019
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, the performance of the lock is greatly improved compared to the previous one, but which rowkey becomes less clear when a lock conflict occurs.

Copy link
Contributor

@andyqian andyqian left a comment

Choose a reason for hiding this comment

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

acquireLock method check lock , better with StringJoiner.

StringJoiner sj = new StringJoiner(","); for (LockDO lockDO : lockDOs) { sj.add("?"); }

Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.

@zjinlei zjinlei merged commit 6752030 into apache:develop Nov 1, 2019
@zjinlei zjinlei deleted the bugfix/db-globalstatus-inconsistent branch November 1, 2019 08:19
@zjinlei zjinlei added the theme: performance An issue or pr that we don't feel is valid label Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: performance An issue or pr that we don't feel is valid
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It is recommended to improve the performance of batch database operations
5 participants