-
Notifications
You must be signed in to change notification settings - Fork 6k
ddl: run add-index subtasks at system keyspace tidb #62045
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: run add-index subtasks at system keyspace tidb #62045
Conversation
Signed-off-by: tangenta <[email protected]>
Hi @tangenta. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #62045 +/- ##
================================================
+ Coverage 72.9246% 74.8263% +1.9016%
================================================
Files 1739 1786 +47
Lines 482820 494656 +11836
================================================
+ Hits 352095 370133 +18038
+ Misses 109169 101418 -7751
- Partials 21556 23105 +1549
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
pkg/domain/domain.go
Outdated
distTaskSessPool := do.sysSessionPool | ||
if keyspace.IsRunningOnUser() { | ||
sp, err := do.GetKSSessPool(keyspace.System) | ||
if err != nil { | ||
return err | ||
} | ||
distTaskSessPool = sp | ||
} | ||
taskManager := storage.NewTaskManager(distTaskSessPool) |
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.
this cannot be merged now, current task still runs on its owner keyspace, we can merge it when we are ready to switch to DXF service
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.
What else do we need to do? I can run add-index job normally after this PR.
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.
seems ok for add-index
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 we enable it, user ks DXF will also try get task/subtasks from SYSTEM ks
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.
we shouldn't change this for all places, and only change where add-index uses TaskManager
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.
For a classical kernel, it should use advancenSessionPool
Signed-off-by: tangenta <[email protected]>
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.
please add a real-tikv test like this one to make sure we do submit and run on DXF service on SYSTEM KS https://github.com/pingcap/tidb/pull/62023/files#diff-4ca8746e7f966fd0f1bc3257edfb8208f38f354c3a33d91c3591eb2d1eaa7376R30
failed to add index on SYSTEM keyspace
|
Signed-off-by: tangenta <[email protected]>
store := ddlObj.store | ||
sessPool := ddlObj.sessPool | ||
taskKS := s.task.Keyspace | ||
if keyspace.IsRunningOnSystem() && taskKS != config.GetGlobalKeyspaceName() { |
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 keyspace.IsRunningOnSystem() && taskKS != config.GetGlobalKeyspaceName() { | |
if taskKS != config.GetGlobalKeyspaceName() { |
taskKS != config.GetGlobalKeyspaceName()
implies it's running on SYSTEM
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.
I think it is better to make it explicit to avoid unexpected executions. (Make kerneltype.NextGen()
and SYSTEM
explicit)
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 add a comment about why we still state it explicitly even though taskKS != config.GetGlobalKeyspaceName() implies it's running on SYSTEM
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 you want to avoid unexpected executions, it's better to use intest.Assert to let it panic in test environment
please add your manually test results when you
|
} | ||
|
||
// NewSessionPool creates a new Session pool. | ||
func NewSessionPool(resPool *pools.ResourcePool) *Pool { | ||
func NewSessionPool(resPool util.SessionPool) *Pool { |
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.
in nextgen, as we are not registering this cross ks session into the SessionManager, so it will not block GC during scanning kv?
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.
Yes, it is a risk. Not sure if the GC worker can execute across keyspaces.
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.
they won't AFAIK
/retest |
@tangenta: 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-sigs/prow repository. |
in your manually test, please also give the result of |
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
Signed-off-by: tangenta <[email protected]>
/hold i am running on SYSTEM, but got error on
|
Signed-off-by: tangenta <[email protected]>
/retest |
@tangenta: 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-sigs/prow repository. |
…into next-gen-add-index-system
Signed-off-by: tangenta <[email protected]>
/unhold |
Signed-off-by: tangenta <[email protected]>
Signed-off-by: tangenta <[email protected]>
/retest |
@D3Hunter: 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-sigs/prow repository. |
/retest |
@D3Hunter: 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-sigs/prow repository. |
/retest |
@D3Hunter: 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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, wjhuang2016 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:
|
What problem does this PR solve?
Issue Number: ref #61702
Problem Summary:
This PR supports adding index at system keyspace TiDB.
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.