Skip to content

Commit

Permalink
ddl: refine fatal log when upgrade failed because of tidb_enable_dist…
Browse files Browse the repository at this point in the history
…_task (#53392)
  • Loading branch information
tangenta authored May 22, 2024
1 parent 61a2981 commit d1b8c5b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/ddl/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ func onCreateTables(d *ddlCtx, t *meta.Meta, job *model.Job) (int64, error) {
// We don't construct jobs for every table, but only tableInfo
// The following loop creates a stub job for every table
//
// &*job clones a stub job from the ActionCreateTables job
stubJob := &*job
// it clones a stub job from the ActionCreateTables job
stubJob := job.Clone()
stubJob.Args = make([]any, 1)
for i := range args {
stubJob.TableID = args[i].ID
Expand Down
2 changes: 1 addition & 1 deletion pkg/disttask/framework/scheduler/scheduler_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func (sm *Manager) startScheduler(basicTask *proto.TaskBase, allocateSlots bool,
sm.slotMgr.unReserve(basicTask, reservedExecID)
}
handle.NotifyTaskChange()
sm.logger.Info("task scheduler exist", zap.Int64("task-id", task.ID))
sm.logger.Info("task scheduler exit", zap.Int64("task-id", task.ID))
}()
metrics.UpdateMetricsForRunTask(task)
scheduler.ScheduleTask()
Expand Down
3 changes: 2 additions & 1 deletion pkg/session/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,8 @@ func checkDistTask(s sessiontypes.Session, ver int64) {
// Not set yet.
return
} else if req.GetRow(0).GetString(0) == variable.On {
logutil.BgLogger().Fatal("check dist task failed, tidb_enable_dist_task is enabled", zap.Error(err))
logutil.BgLogger().Fatal("cannot upgrade when tidb_enable_dist_task is enabled, "+
"please set tidb_enable_dist_task to off before upgrade", zap.Error(err))
}

// Even if the variable is set to `off`, we still need to check the tidb_global_task.
Expand Down

0 comments on commit d1b8c5b

Please sign in to comment.