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

fix #853 change delete undolog to batch delete #856

Merged
merged 10 commits into from
Apr 23, 2019

Conversation

github-ygy
Copy link
Contributor

Ⅰ. Describe what this PR did

change delete undolog to batch delete

Ⅱ. Does this pull request fix one issue?

fix #853

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

UndoLogManagerTest

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Apr 19, 2019

Codecov Report

Merging #856 into develop will increase coverage by 0.24%.
The diff coverage is 56.86%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #856      +/-   ##
=============================================
+ Coverage      38.05%   38.29%   +0.24%     
- Complexity      1005     1013       +8     
=============================================
  Files            220      220              
  Lines           8452     8499      +47     
  Branches        1015     1023       +8     
=============================================
+ Hits            3216     3255      +39     
- Misses          4852     4859       +7     
- Partials         384      385       +1
Impacted Files Coverage Δ Complexity Δ
.../main/java/io/seata/rm/datasource/AsyncWorker.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...va/io/seata/rm/datasource/undo/UndoLogManager.java 23.77% <87.87%> (+23.77%) 8 <7> (+8) ⬆️
...eata/core/rpc/netty/AbstractRpcRemotingClient.java 17.7% <0%> (+0.47%) 7% <0%> (ø) ⬇️
...eata/server/store/FileTransactionStoreManager.java 54% <0%> (+1%) 15% <0%> (ø) ⬇️
...o/seata/server/coordinator/DefaultCoordinator.java 53.57% <0%> (+1.42%) 16% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58284ea...65fc4b3. Read the comment docs.

Copy link
Contributor

@CoffeeLatte007 CoffeeLatte007 left a comment

Choose a reason for hiding this comment

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

I left some comment

Copy link
Contributor

@CoffeeLatte007 CoffeeLatte007 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

@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.

@xingfudeshi xingfudeshi merged commit 4dc85f1 into apache:develop Apr 23, 2019
@@ -171,15 +175,33 @@ private void doBranchCommits() {
continue;
}
List<Phase2Context> contextsGroupedByResourceId = entry.getValue();
Set<String> xids = new LinkedHashSet<>(UNDOLOG_DELETE_LIMIT_SIZE);
Copy link
Member

Choose a reason for hiding this comment

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

SIZE always 2^n

int xidSize = xids.size();
int branchIdSize = branchIds.size();
String batchDeleteSql = toBatchDeleteUndoLogSql(xidSize, branchIdSize,limitSize);
PreparedStatement deletePST = conn.prepareStatement(batchDeleteSql);
Copy link
Member

Choose a reason for hiding this comment

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

PreparedStatement will be invalid cause by the number different

appendInParam(xidSize, sqlBuilder);
sqlBuilder.append(" AND xid IN ");
appendInParam(branchIdSize, sqlBuilder);
sqlBuilder.append(" LIMIT ").append(limitSize);
Copy link
Member

Choose a reason for hiding this comment

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

need limit?

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.

change delete undolog to batch
7 participants