-
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
disttask: rename dispatcher to scheduler #49182
Conversation
/ok-to-test |
@@ -153,7 +153,7 @@ func TestBackfillingDispatcherGlobalSortMode(t *testing.T) { | |||
ctx = util.WithInternalSourceType(ctx, "handle") | |||
mgr := storage.NewTaskManager(pool) | |||
storage.SetTaskManager(mgr) | |||
dspManager, err := dispatcher.NewManager(util.WithInternalSourceType(ctx, "dispatcher"), mgr, "host:port") | |||
dspManager, err := scheduler.NewManager(util.WithInternalSourceType(ctx, "scheduler"), mgr, "host:port") |
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.
dspManager, err := scheduler.NewManager(util.WithInternalSourceType(ctx, "scheduler"), mgr, "host:port") | |
scheManager, err := scheduler.NewManager(util.WithInternalSourceType(ctx, "scheduler"), mgr, "host:port") |
@@ -51,11 +51,11 @@ func (dm *Manager) getRunningTaskCnt() int { | |||
return len(dm.runningTasks.taskIDs) | |||
} | |||
|
|||
func (dm *Manager) setRunningTask(task *proto.Task, dispatcher Dispatcher) { | |||
func (dm *Manager) setRunningTask(task *proto.Task, scheduler Scheduler) { | |||
dm.runningTasks.Lock() |
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.
sm
} | ||
|
||
// refreshTask fetch task state from tidb_global_task table. | ||
func (d *BaseDispatcher) refreshTask() error { | ||
func (d *BaseScheduler) refreshTask() error { |
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.
func (d *BaseScheduler) refreshTask() error { | |
func (s *BaseScheduler) refreshTask() error { |
@@ -975,7 +975,7 @@ func (stm *TaskManager) TransferTasks2History(ctx context.Context, tasks []*prot | |||
return stm.WithNewTxn(ctx, func(se sessionctx.Context) error { | |||
insertSQL := new(strings.Builder) | |||
if err := sqlescape.FormatSQL(insertSQL, "replace into mysql.tidb_global_task_history"+ | |||
"(id, task_key, type, dispatcher_id, state, priority, start_time, state_update_time,"+ | |||
"(id, task_key, type, scheduler_id, state, priority, start_time, state_update_time,"+ |
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.
won't pass the test
@@ -61,7 +61,7 @@ func (s *importIntoSuite) TestDispatcherGetEligibleInstances() { | |||
} | |||
mockedAllServerInfos := makeFailpointRes(serverInfoMap) | |||
|
|||
dsp := ImportDispatcherExt{} | |||
dsp := ImportSchedulerExt{} |
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.
ditto
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #49182 +/- ##
================================================
+ Coverage 71.0517% 71.7332% +0.6815%
================================================
Files 1368 1414 +46
Lines 401578 414951 +13373
================================================
+ Hits 285328 297658 +12330
- Misses 96418 98491 +2073
+ Partials 19832 18802 -1030
Flags with carried forward coverage won't be shown. Click here to find out more.
|
PR needs rebase. 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. |
667e1c2
to
c4285c9
Compare
c4285c9
to
28cb579
Compare
pkg/session/bootstrap.go
Outdated
@@ -573,7 +573,7 @@ const ( | |||
id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, | |||
task_key VARCHAR(256) NOT NULL, | |||
type VARCHAR(256) NOT NULL, | |||
dispatcher_id VARCHAR(256), | |||
scheduler_id VARCHAR(256), |
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.
the table field will update later, better not in this pr
…nto rename-dispatcher
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
pkg/errno/logredaction.md
Outdated
@@ -25,9 +25,9 @@ ERROR 1062 (23000): Duplicate entry '?' for key '?' | |||
|
|||
And its corresponding log is: | |||
``` | |||
[2020/10/20 11:45:37.796 +08:00] [INFO] [conn.go:800] ["command dispatched failed"] [conn=5] [connInfo="id:5, addr:127.0.0.1:57222 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="insert into t values (1),(1)"] [txn_mode=OPTIMISTIC] [err="[kv:1062]Duplicate entry '1' for key 'a'"] | |||
[2020/10/20 11:45:37.796 +08:00] [INFO] [conn.go:800] ["command scheduled failed"] [conn=5] [connInfo="id:5, addr:127.0.0.1:57222 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="insert into t values (1),(1)"] [txn_mode=OPTIMISTIC] [err="[kv:1062]Duplicate entry '1' for key 'a'"] |
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 is not part of disttask
pkg/ddl/job_table.go
Outdated
@@ -50,13 +50,13 @@ import ( | |||
|
|||
var ( | |||
addingDDLJobConcurrent = "/tidb/ddl/add_ddl_job_general" | |||
dispatchLoopWaitingDuration = 1 * time.Second |
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 this is not part of framework
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, ywqzzy 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 |
What problem does this PR solve?
Issue Number: close #49125
Problem Summary:
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.