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

executor: compute ADMIN CHECKSUM for partitioned tables correctly #11089

Merged
merged 2 commits into from
Jul 15, 2019

Conversation

kennytm
Copy link
Contributor

@kennytm kennytm commented Jul 4, 2019

What problem does this PR solve?

Fix #10796. The ADMIN CHECKSUM TABLE of a partition table was not computed correctly since the actual data and indices are stored in the child physical tables (the partitions).

What is changed and how it works?

If a table has partitions, push the checksum requests for those tables too.

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
    • Checksum passed when importing a partitioned table with Lightning.

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

@codecov
Copy link

codecov bot commented Jul 4, 2019

Codecov Report

Merging #11089 into master will decrease coverage by 0.2187%.
The diff coverage is 72.7272%.

@@               Coverage Diff               @@
##            master     #11089        +/-   ##
===============================================
- Coverage   81.222%   81.0032%   -0.2188%     
===============================================
  Files          420        419         -1     
  Lines        90031      89347       -684     
===============================================
- Hits         73125      72374       -751     
- Misses       11675      11729        +54     
- Partials      5231       5244        +13

@codecov
Copy link

codecov bot commented Jul 4, 2019

Codecov Report

Merging #11089 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #11089   +/-   ##
===========================================
  Coverage   81.7694%   81.7694%           
===========================================
  Files           423        423           
  Lines         91928      91928           
===========================================
  Hits          75169      75169           
  Misses        11458      11458           
  Partials       5301       5301

@kennytm
Copy link
Contributor Author

kennytm commented Jul 5, 2019

PTAL @lamxTyler

(I'm not sure what happened with the coverage 😕)

}

reqs := make([]*kv.Request, 0, (len(c.TableInfo.Indices)+1)*(len(partDefs)+1))
if err := c.appendRequest(ctx, c.TableInfo.ID, &reqs); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we save the request to the table when it is a partitioned table since it won't have any data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we could (add an if clause), but since the range contains no data I think the overhead would be small. OTOH if we do want to support global index, I suppose those indices will be placed in the table itself, so we still need to appendRequest(c.TableInfo.ID).

Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@kennytm kennytm added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 5, 2019
@kennytm
Copy link
Contributor Author

kennytm commented Jul 5, 2019

PTAL @winkyao

@kennytm
Copy link
Contributor Author

kennytm commented Jul 10, 2019

😐

PTAL @zz-jason

@kennytm
Copy link
Contributor Author

kennytm commented Jul 15, 2019

/run-all-tests

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 15, 2019
@zz-jason zz-jason merged commit 368119b into pingcap:master Jul 15, 2019
@kennytm kennytm deleted the checksum-partitioned-table branch July 16, 2019 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use tidb-lightning problem
3 participants