From ad616f81376e9a0dbc188c2dbca99a4fb8fc8e57 Mon Sep 17 00:00:00 2001 From: wjHuang Date: Sat, 2 Apr 2022 19:26:29 +0800 Subject: [PATCH] cherry pick #33677 to release-5.1 Signed-off-by: ti-srebot --- ddl/ddl.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ddl/ddl.go b/ddl/ddl.go index 9eb05b86741ed..be8178dd7cabf 100644 --- a/ddl/ddl.go +++ b/ddl/ddl.go @@ -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 { @@ -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)