-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
ddl: fix the optimization for the empty table(speed up) #49629
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #49629 +/- ##
================================================
+ Coverage 71.0037% 71.7359% +0.7322%
================================================
Files 1368 1429 +61
Lines 399344 430788 +31444
================================================
+ Hits 283549 309030 +25481
- Misses 96005 102862 +6857
+ Partials 19790 18896 -894
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ef75d2f
to
d5a97ea
Compare
d5a97ea
to
8f492a4
Compare
if len(startKey) == 0 && len(endKey) == 0 { | ||
logutil.BgLogger().Info("split table range from PD, get noop table range", zap.String("category", "ddl"), zap.Int64("physicalTableID", t.GetPhysicalID())) | ||
return []kv.KeyRange{}, nil | ||
} | ||
|
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.
Why not check this in origin place? Thus we can skip setupWorkers()
and consumer.run()
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.
Because there will be return an error as described in #49682
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, tangenta The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/retest |
@wuhuizuo: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
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 |
/cherry-pick release-6.5 |
In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tidb#release-6.5 from head ti-chi-bot:cherry-pick-49629-to-release-6.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-49629-to-release-6.5."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"} |
@ti-chi-bot: new pull request could not be created: failed to create pull request against pingcap/tidb#release-6.5 from head ti-chi-bot:cherry-pick-49629-to-release-6.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-49629-to-release-6.5."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"} In response to this:
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. |
What problem does this PR solve?
Issue Number: close #49679, close #49682
Problem Summary:
The optimization for the empty table(
startKey == nil && endKey == nil)
doesn't work.The following case is obvious (because split regions take so long).
#49679
What changed and how does it work?
Check List
Tests
Before this PR, took time: 2min+
After this PR, took time: 40s+
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.