Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ywqzzy committed Jan 9, 2024
1 parent fcc5e2c commit 1cbf435
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pkg/disttask/framework/storage/task_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,9 @@ func (mgr *TaskManager) StartSubtask(ctx context.Context, subtaskID int64, execI
}

// InitMeta insert the manager information into dist_framework_meta.
func (stm *TaskManager) InitMeta(ctx context.Context, tidbID string, role string) error {
return stm.WithNewSession(func(se sessionctx.Context) error {
return stm.InitMetaSession(ctx, se, tidbID, role)
func (mgr *TaskManager) InitMeta(ctx context.Context, tidbID string, role string) error {
return mgr.WithNewSession(func(se sessionctx.Context) error {
return mgr.InitMetaSession(ctx, se, tidbID, role)
})
}

Expand All @@ -706,9 +706,9 @@ func (*TaskManager) InitMetaSession(ctx context.Context, se sessionctx.Context,
// if the record exists, update the cpu_count.
// Don't update role for we only update it in `set global tidb_service_scope`.
// if not there might has a data race.
func (stm *TaskManager) RecoverMeta(ctx context.Context, execID string, role string) error {
func (mgr *TaskManager) RecoverMeta(ctx context.Context, execID string, role string) error {
cpuCount := cpu.GetCPUCount()
_, err := stm.executeSQLWithNewSession(ctx, `
_, err := mgr.executeSQLWithNewSession(ctx, `
insert into mysql.dist_framework_meta(host, role, cpu_count, keyspace_id)
values (%?, %?, %?, -1)
on duplicate key
Expand Down
2 changes: 1 addition & 1 deletion pkg/disttask/framework/storage/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func GetSubtaskEndTimeForTest(ctx context.Context, mgr *TaskManager, subtaskID i
// GetSubtaskNodesForTest gets subtasks running nodes for one task for test.
func GetSubtaskNodesForTest(ctx context.Context, mgr *TaskManager, taskID int64) ([]string, error) {
rs, err := mgr.executeSQLWithNewSession(ctx,
`select exec_id from mysql.tidb_background_subtask where task_key=%? group by exec_id`, taskID)
`select distinct(exec_id) from mysql.tidb_background_subtask where task_key=%?`, taskID)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1cbf435

Please sign in to comment.