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

bootstrap: use BatchCreateTableWithInfo to speed up #42432

Closed
wants to merge 11 commits into from

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Mar 21, 2023

What problem does this PR solve?

Issue Number: close #42434

Problem Summary:

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@lance6716 lance6716 requested a review from a team as a code owner March 21, 2023 08:44
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/needs-triage-completed and removed do-not-merge/needs-linked-issue labels Mar 21, 2023
Signed-off-by: lance6716 <[email protected]>
@lance6716
Copy link
Contributor Author

/check-issue-triage-complete

Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
Signed-off-by: lance6716 <[email protected]>
@lance6716
Copy link
Contributor Author

/retest

@@ -5663,9 +5663,10 @@ func TestAdmin(t *testing.T) {
tk.MustExec("use test")
tk.MustExec("drop table if exists admin_test2")
tk.MustExec("create table admin_test2 (c1 int, c2 int, c3 int default 1, index (c1))")
// we cn only see last 10 queries
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
// we cn only see last 10 queries
// we can only see last 10 queries

Due to BatchCreateTableWithInfo, we have less history DDL jobs

@lance6716
Copy link
Contributor Author

/cc @bb7133

@ti-chi-bot ti-chi-bot requested a review from bb7133 March 21, 2023 11:57
}
tableInfosPart1 = append(tableInfosPart1, tblInfo)
}
batchCreateTable(s, dom.DDL(), tableInfosPart1)
mustExecute(s, CreateMDLView)
Copy link
Member

Choose a reason for hiding this comment

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

So why CreateMDLView is skipped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

98b8e9e

add comment

Signed-off-by: lance6716 <[email protected]>
@ti-chi-bot
Copy link
Member

@lance6716: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/mysql-test 98b8e9e link true /test mysql-test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Contributor

@tiancaiamao tiancaiamao left a comment

Choose a reason for hiding this comment

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

This affects not only the test logic, but also the real bootstrap processing.
I have another idea: can we use a bootstraped store as the image for testing, so the bootstrap in testing can be totally avoided?

@lance6716
Copy link
Contributor Author

lance6716 commented Mar 23, 2023

This affects not only the test logic, but also the real bootstrap processing. I have another idea: can we use a bootstraped store as the image for testing, so the bootstrap in testing can be totally avoided?

Yes that seems safer but I don't know how to do it. I guess I should prepare a bootstrapped KV store in some init(), and copy all KV to newly created test store in

func NewMockStore(options ...MockTiKVStoreOption) (kv.Storage, error) {
. Can you help me check this idea? (For example, can all KV be copied?)

@ti-chi-bot
Copy link
Member

@lance6716: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 23, 2023
@lance6716
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2023
@tiancaiamao
Copy link
Contributor

This affects not only the test logic, but also the real bootstrap processing. I have another idea: can we use a bootstraped store as the image for testing, so the bootstrap in testing can be totally avoided?

Yes that seems safer but I don't know how to do it. I guess I should prepare a bootstrapped KV store in some init(), and copy all KV to newly created test store in

func NewMockStore(options ...MockTiKVStoreOption) (kv.Storage, error) {

. Can you help me check this idea? (For example, can all KV be copied?)

OK, let me have a try.

@lance6716
Copy link
Contributor Author

can be replaced by #42521

@lance6716 lance6716 closed this Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI timeout due to bootstrap is very slow
5 participants