diff --git a/ddl/index.go b/ddl/index.go index 7c9fc1d083ff4..929a86b08321b 100644 --- a/ddl/index.go +++ b/ddl/index.go @@ -703,15 +703,18 @@ func pickBackfillType(w *worker, job *model.Job) model.ReorgType { return job.ReorgMeta.ReorgTp } if IsEnableFastReorg() { - canUseIngest := canUseIngest(w) - if ingest.LitInitialized && canUseIngest { - job.ReorgMeta.ReorgTp = model.ReorgTypeLitMerge - return model.ReorgTypeLitMerge + var useIngest bool + if ingest.LitInitialized { + useIngest = canUseIngest(w) + if useIngest { + job.ReorgMeta.ReorgTp = model.ReorgTypeLitMerge + return model.ReorgTypeLitMerge + } } // The lightning environment is unavailable, but we can still use the txn-merge backfill. logutil.BgLogger().Info("[ddl] fallback to txn-merge backfill process", zap.Bool("lightning env initialized", ingest.LitInitialized), - zap.Bool("can use ingest", canUseIngest)) + zap.Bool("can use ingest", useIngest)) job.ReorgMeta.ReorgTp = model.ReorgTypeTxnMerge return model.ReorgTypeTxnMerge } diff --git a/ddl/main_test.go b/ddl/main_test.go index 3418d16a23ece..6a8642ae34380 100644 --- a/ddl/main_test.go +++ b/ddl/main_test.go @@ -64,6 +64,8 @@ func TestMain(m *testing.M) { goleak.IgnoreTopFunction("go.etcd.io/etcd/client/pkg/v3/logutil.(*MergeLogger).outputLoop"), goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/txnkv/transaction.keepAlive"), goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"), + goleak.IgnoreTopFunction("internal/poll.runtime_pollWait"), + goleak.IgnoreTopFunction("net/http.(*persistConn).writeLoop"), } goleak.VerifyTestMain(m, opts...)