-
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
*: add session var 'tidb_ddl_reorg_worker_cnt' to control ddl reorg workers count #6441
Changes from 9 commits
a2a95e6
bd3e576
9944329
9a66045
8ca59aa
56928e3
6265d6e
230285b
add416d
0440006
64e6cbc
81caeca
31c0162
680c202
427acdf
195c46c
314e00c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -531,6 +531,9 @@ func (s *SessionVars) SetSystemVar(name string, val string) error { | |
s.EnableStreaming = TiDBOptOn(val) | ||
case TiDBOptimizerSelectivityLevel: | ||
s.OptimizerSelectivityLevel = tidbOptPositiveInt32(val, DefTiDBOptimizerSelectivityLevel) | ||
case TiDBDDLReorgWorkerCount: | ||
workerCnt := tidbOptPositiveInt32(val, DefTiDBDDLReorgWorkerCount) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to have an upper limit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
SetDDLReorgWorkerCounter(int32(workerCnt)) | ||
} | ||
s.systems[name] = val | ||
return nil | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,9 @@ const ( | |
|
||
// tidb_backoff_lock_fast is used for tikv backoff base time in milliseconds. | ||
TiDBBackoffLockFast = "tidb_backoff_lock_fast" | ||
|
||
// tidb_ddl_reorg_worker_cnt defines the count of ddl reorg workers. | ||
TiDBDDLReorgWorkerCount = "tidb_ddl_reorg_worker_cnt" | ||
) | ||
|
||
// Default TiDB system variable values. | ||
|
@@ -189,9 +192,11 @@ const ( | |
DefTiDBRetryLimit = 10 | ||
DefTiDBHashJoinConcurrency = 5 | ||
DefTiDBOptimizerSelectivityLevel = 0 | ||
DefTiDBDDLReorgWorkerCount = 16 | ||
) | ||
|
||
// Process global variables. | ||
var ( | ||
ProcessGeneralLog uint32 | ||
ProcessGeneralLog uint32 | ||
DDLReorgWorkerCounter int32 = DefTiDBDDLReorgWorkerCount | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/DDLReorgWorkerCounter/ddlReorgWorkerCounter ? |
||
) |
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.
Could we support updating worker counter when the workers are running?
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.
Will be fixed later, not this PR.