Skip to content

Commit

Permalink
cherry pick pingcap#33677 to release-5.1
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <[email protected]>
  • Loading branch information
wjhuang2016 authored and ti-srebot committed Apr 2, 2022
1 parent ec7d6b3 commit ad616f8
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 @@ -345,6 +345,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 @@ -354,7 +356,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 ad616f8

Please sign in to comment.