Skip to content

Commit

Permalink
cherry pick pingcap#33677 to release-5.4
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 b1c5a67 commit adddaee
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 @@ -350,6 +350,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 @@ -359,7 +361,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(d.ctx, generalWorker, d.sessPool, d.delRangeMgr)
d.workers[addIdxWorker] = newWorker(d.ctx, addIdxWorker, d.sessPool, d.delRangeMgr)
Expand Down

0 comments on commit adddaee

Please sign in to comment.