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: split & scatter regions concurrently #27034

Merged
merged 25 commits into from
Aug 26, 2021

Conversation

YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Aug 9, 2021

Port of pingcap/br#1363

What problem does this PR solve?

Before, when restoring many small tables, the batcher would probably send small batch due to the so called AutoCommit feature of the batcher. By this, we can make the split & scatter & restore worker more active.

But frequently send small batches isn't free. The split step is costly and I/O bounded for even small batches. For example, it costs about 3s to splitting 60 ranges, but restore those ranges typically costs only 1s. Then the restore worker get idle at most time. The restore hence has slowed down.

BR pipeline-2

What is changed and how it works?

Instead of using a single split worker, this PR allow multi restore batches be split concurrently.
We added two hidden flags, --batch-flush-interval and --pd-concurrency, the former for better tuning the behavior of batcher, the latter for tweaking the concurrent split.
Also, more logs were added so the create table speed, download, ingest time cost can be observed via log.

Check List

Tests

  • Integration test
  • Manual test (add detailed scripts or steps below)
    A internal test shows, in a 190GB, 6000 tables workload, this PR can speed up the restoration: the original version takes over 2 hours for restoring, and this version takes about 30mins for restoring. The latter is nearly equal to the time cost of creating tables(see figure below).

image

Release note

Restore many small tables would be faster now.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 9, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Little-Wallace
  • kennytm

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/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 9, 2021
@YuJuncen
Copy link
Contributor Author

YuJuncen commented Aug 9, 2021

/sig migrate

@YuJuncen
Copy link
Contributor Author

YuJuncen commented Aug 9, 2021

/cc Little-Wallace
/cc 3pointer

@3pointer
Copy link
Contributor

3pointer commented Aug 9, 2021

/run-integration-tests

1 similar comment
@3pointer
Copy link
Contributor

3pointer commented Aug 9, 2021

/run-integration-tests

@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 12, 2021
@kennytm
Copy link
Contributor

kennytm commented Aug 12, 2021

/component br

@ti-chi-bot ti-chi-bot added the component/br This issue is related to BR of TiDB. label Aug 12, 2021
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 15, 2021
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 16, 2021
@YuJuncen
Copy link
Contributor Author

/run-integration-test

@YuJuncen
Copy link
Contributor Author

/run-integration-tests

@YuJuncen
Copy link
Contributor Author

/run-check_dev_2

So many unit tests >= 5s...

Copy link
Contributor

@Little-Wallace Little-Wallace left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 17, 2021
Copy link
Contributor

@kennytm kennytm 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

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 25, 2021
@YuJuncen
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: afe9bd3

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 26, 2021
@ti-chi-bot
Copy link
Member

@YuJuncen: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit cdadfdb into pingcap:master Aug 26, 2021
joccau pushed a commit to joccau/tidb that referenced this pull request Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/br This issue is related to BR of TiDB. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/migrate size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants