Skip to content

Commit

Permalink
ddl: build sessPool even if RunWorker == false (#33677) (#33697)
Browse files Browse the repository at this point in the history
close #33676
  • Loading branch information
ti-srebot authored Apr 28, 2022
1 parent d1eac99 commit ddd815c
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 ddd815c

Please sign in to comment.