Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: wjhuang2016 <[email protected]>
  • Loading branch information
wjhuang2016 committed May 22, 2023
1 parent b4ffb5b commit 3729433
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 0 additions & 7 deletions ddl/dist_owner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -27,7 +24,3 @@ var CheckBackfillJobFinishInterval = 300 * time.Millisecond
const (
distPhysicalTableConcurrency = 16
)

func initDistReorg(reorgMeta *model.DDLReorgMeta) {
reorgMeta.IsDistReorg = variable.EnableDistTask.Load()
}
6 changes: 4 additions & 2 deletions ddl/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
}
}
Expand Down

0 comments on commit 3729433

Please sign in to comment.