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

restore: support table partition #137

Merged
merged 13 commits into from Jan 7, 2020
Merged

Conversation

5kbpers
Copy link
Contributor

@5kbpers 5kbpers commented Jan 6, 2020

Support table partition:

  1. add rewrite rule for table partition
  2. fix table partition checksum
  3. refactor logic about key rewrite

5kbpers and others added 7 commits January 6, 2020 00:35
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
@codecov
Copy link

codecov bot commented Jan 6, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@6dde545). Click here to learn what that means.
The diff coverage is 60.86%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #137   +/-   ##
=========================================
  Coverage          ?   72.95%           
=========================================
  Files             ?       33           
  Lines             ?     3257           
  Branches          ?        0           
=========================================
  Hits              ?     2376           
  Misses            ?      591           
  Partials          ?      290
Impacted Files Coverage Δ
cmd/validate.go 66.66% <ø> (ø)
pkg/utils/schema.go 57.57% <ø> (ø)
cmd/restore.go 64.5% <100%> (ø)
pkg/restore/import.go 66.1% <40%> (ø)
pkg/restore/util.go 82.92% <62.5%> (ø)

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 6dde545...0e429c7. Read the comment docs.

Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Copy link
Member

@overvenus overvenus left a comment

Choose a reason for hiding this comment

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

Rest LGTM

// Sort the tables by id for ensuring the new tables has same id ordering as the old tables.
// We require this constrain since newTableID of tableID+1 must be not bigger
// than newTableID of tableID.
sort.Sort(utils.Tables(tables))
Copy link
Member

@overvenus overvenus Jan 7, 2020

Choose a reason for hiding this comment

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

Can we remove utils.Tables?

rewriteRules.Table = append(rewriteRules.Table, rules.Table...)
rewriteRules.Data = append(rewriteRules.Data, rules.Data...)
newTables = append(newTables, newTableInfo)
}
// If tableID + 1 has already exist, then we don't need to add a new rewrite rule for it.
for oldID, newID := range tableIDMap {
Copy link
Member

Choose a reason for hiding this comment

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

We should update validate.go since we change the rewrite process.

Signed-off-by: 5kbpers <tangminghua@pingcap.com>
Copy link
Collaborator

@3pointer 3pointer 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

@overvenus overvenus left a comment

Choose a reason for hiding this comment

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

LGTM

@overvenus overvenus merged commit 660ea64 into pingcap:master Jan 7, 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

3 participants