Skip to content

Commit

Permalink
cherry pick pingcap#33677 to release-4.0
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
wjhuang2016 authored and ti-srebot committed Apr 2, 2022
1 parent 75f81d2 commit df59cfa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ func (d *ddl) Start(ctxPool *pools.ResourcePool) error {
d.wg.Add(1)
go d.limitDDLJobs()

d.sessPool = newSessionPool(ctxPool)

// If RunWorker is true, we need campaign owner and do DDL job.
// Otherwise, we needn't do that.
if RunWorker {
Expand All @@ -335,7 +337,6 @@ func (d *ddl) Start(ctxPool *pools.ResourcePool) error {
}

d.workers = make(map[workerType]*worker, 2)
d.sessPool = newSessionPool(ctxPool)
d.delRangeMgr = d.newDeleteRangeManager(ctxPool == nil)
d.workers[generalWorker] = newWorker(generalWorker, d.store, d.sessPool, d.delRangeMgr)
d.workers[addIdxWorker] = newWorker(addIdxWorker, d.store, d.sessPool, d.delRangeMgr)
Expand Down

0 comments on commit df59cfa

Please sign in to comment.