diff --git a/ddl/dist_owner.go b/ddl/dist_owner.go index 6d53a99038fea..aced50d4bf864 100644 --- a/ddl/dist_owner.go +++ b/ddl/dist_owner.go @@ -16,9 +16,6 @@ package ddl import ( "time" - - "github.com/pingcap/tidb/parser/model" - "github.com/pingcap/tidb/sessionctx/variable" ) // CheckBackfillJobFinishInterval is export for test. @@ -27,7 +24,3 @@ var CheckBackfillJobFinishInterval = 300 * time.Millisecond const ( distPhysicalTableConcurrency = 16 ) - -func initDistReorg(reorgMeta *model.DDLReorgMeta) { - reorgMeta.IsDistReorg = variable.EnableDistTask.Load() -} diff --git a/ddl/index.go b/ddl/index.go index dd273705f0b1e..368eae0373c2c 100644 --- a/ddl/index.go +++ b/ddl/index.go @@ -624,7 +624,6 @@ func (w *worker) onCreateIndex(d *ddlCtx, t *meta.Meta, job *model.Job, isPK boo case model.StateNone: // none -> delete only var reorgTp model.ReorgType - initDistReorg(job.ReorgMeta) reorgTp, err = pickBackfillType(w.ctx, job, indexInfo.Unique, d) if err != nil { break @@ -733,7 +732,7 @@ func pickBackfillType(ctx context.Context, job *model.Job, unique bool, d *ddlCt if err != nil { return model.ReorgTypeNone, err } - if job.ReorgMeta.IsDistReorg { + if variable.EnableDistTask.Load() { _, err = ingest.LitBackCtxMgr.Register(ctx, unique, job.ID, d.etcdCli) } else { _, err = ingest.LitBackCtxMgr.Register(ctx, unique, job.ID, nil) @@ -742,6 +741,9 @@ func pickBackfillType(ctx context.Context, job *model.Job, unique bool, d *ddlCt return model.ReorgTypeNone, err } job.ReorgMeta.ReorgTp = model.ReorgTypeLitMerge + if variable.EnableDistTask.Load() { + job.ReorgMeta.IsDistReorg = true + } return model.ReorgTypeLitMerge, nil } }