br: reused table id is disabled when restore a brand-new cluster#41358
br: reused table id is disabled when restore a brand-new cluster#41358ti-chi-bot merged 17 commits intopingcap:masterfrom
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. DetailsReviewer can indicate their review by submitting an approval review. |
Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
br/pkg/gluetidb/glue.go
Outdated
| } | ||
| mid := len(info) / 2 | ||
| err = gs.SplitBatchCreateTable(schema, info[:mid]) | ||
| err = gs.SplitBatchCreateTable(schema, info[:mid], cs...) |
There was a problem hiding this comment.
Maybe do not use optional arguments here?
| d := dom.DDL() | ||
| require.NotNil(t, d) | ||
|
|
||
| infos1 := []*model.TableInfo{} |
There was a problem hiding this comment.
and also add a case that len(infos)==0
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.
| 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.
can we add a check that id has reused?
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 4694132 |
|
/test unit-test |
1 similar comment
|
/test unit-test |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit 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 <ti-community-prow-bot@tidb.io>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
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.