-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
br: reused table id is disabled when restore a brand-new cluster #41358
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm
br/pkg/gluetidb/glue.go
Outdated
@@ -226,11 +226,11 @@ func (gs *tidbSession) SplitBatchCreateTable(schema model.CIStr, info []*model.T | |||
return err | |||
} | |||
mid := len(info) / 2 | |||
err = gs.SplitBatchCreateTable(schema, info[:mid]) | |||
err = gs.SplitBatchCreateTable(schema, info[:mid], cs...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe do not use optional arguments here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remote opt parameter in dd7388a
d := dom.DDL() | ||
require.NotNil(t, d) | ||
|
||
infos1 := []*model.TableInfo{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also add a case that len(infos)==0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add new case in dd7388a
br/pkg/gluetidb/glue.go
Outdated
err = d.BatchCreateTableWithInfo(gs.se, schema, infos, append(cs, ddl.OnExistIgnore)...) | ||
failpoint.Inject("RestoreBatchCreateTableEntryTooLarge", func(val failpoint.Value) { | ||
if val.(bool) { | ||
if len(infos) > 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(infos) > 1 { |
br/pkg/gluetidb/glue_test.go
Outdated
|
||
require.NoError(t, err) | ||
|
||
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/br/pkg/gluetidb/RestoreBatchCreateTableEntryTooLarge")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a check that id has reused?
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 4694132
|
/test unit-test |
1 similar comment
/test unit-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 594db2b
|
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #41333
Problem Summary:
when restoring to a brand-new cluster, reused table id was disabled, which caused restore to consume more resources.
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.