-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
variable, ddl: add session variable 'tidb_ddl_reorg_priority' to set operation priority of ddl reorg #7116
variable, ddl: add session variable 'tidb_ddl_reorg_priority' to set operation priority of ddl reorg #7116
Conversation
…operation priority of ddl reorg
Please add proper labels. |
This PR should be metioned in the release notes. |
/run-all-tests |
…rol_reorg_priority
@winkyao Please resolve conflicts. |
…rol_reorg_priority
|
||
cli.mu.Lock() | ||
cli.mu.checkFlags = checkRequestOff | ||
cli.mu.Unlock() |
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 can't understand the test is used to test what?
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.
test if the following set priority operation takes effect.
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.
Which line to check if the following set priority operation takes effect?
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.
You can look into checkRequestClient.SendRequest
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.
Got it~
…rol_reorg_priority
|
||
cli.mu.Lock() | ||
cli.mu.checkFlags = checkRequestOff | ||
cli.mu.Unlock() |
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.
Got it~
meta/meta.go
Outdated
job := &model.Job{} | ||
job := &model.Job{ | ||
// for compability, if the job is enqueued by old version TiDB and Priority field is omitted, | ||
// set the default priority to kv.PriorityLow |
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.
end with .
meta/meta.go
Outdated
@@ -504,8 +504,16 @@ func (m *Meta) getDDLJob(key []byte, index int64) (*model.Job, error) { | |||
return nil, errors.Trace(err) | |||
} | |||
|
|||
job := &model.Job{} | |||
job := &model.Job{ | |||
// for compability, if the job is enqueued by old version TiDB and Priority field is omitted, |
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.
s/for/For
meta/meta.go
Outdated
err = job.Decode(value) | ||
// check job.Priority is valid. |
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.
s/check/Check
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.
LGTM
case "priority_normal": | ||
s.DDLReorgPriority = kv.PriorityNormal | ||
case "priority_high": | ||
s.DDLReorgPriority = kv.PriorityHigh |
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 default clause?
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.
Do agree with @zhexuany.
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.
Done
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.
LGTM
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.
reset LGTM.
LGTM |
What have you changed? (mandatory)
Add session variable 'tidb_ddl_reorg_priority' to set operation priority of ddl reorg. Before this PR, the operation in adding indices is definitely in low priority, In some case, we want to finish DDL job as fast as possible, after this PR, we can set the variable
tidb_ddl_reorg_priority
topriority_high
to achieve it.What is the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
UT
Does this PR affect documentation (docs/docs-cn) update? (mandatory)
YES
Does this PR affect tidb-ansible update? (mandatory)
NO
Does this PR need to be added to the release notes? (mandatory)
YES:
Refer to a related PR or issue link (optional)
Benchmark result if necessary (optional)
Add a few positive/negative examples (optional)