From a71da8b258d0260a7a37094d441dfd5ba000ed60 Mon Sep 17 00:00:00 2001 From: D3Hunter Date: Thu, 26 Dec 2024 14:43:07 +0800 Subject: [PATCH] change --- pkg/ddl/ddl.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/pkg/ddl/ddl.go b/pkg/ddl/ddl.go index bf610f676306c..cf772f6f56ba9 100644 --- a/pkg/ddl/ddl.go +++ b/pkg/ddl/ddl.go @@ -397,19 +397,7 @@ func (sv *schemaVersionManager) setSchemaVersion(jobCtx *jobContext, job *model. if err != nil { return schemaVersion, errors.Trace(err) } - // TODO we can merge this txn into job transaction to avoid schema version - // without differ. - start := time.Now() - err = kv.RunInNewTxn(kv.WithInternalSourceType(context.Background(), kv.InternalTxnDDL), sv.store, true, func(_ context.Context, txn kv.Transaction) error { - var err error - m := meta.NewMutator(txn) - schemaVersion, err = m.GenSchemaVersion() - return err - }) - defer func() { - metrics.DDLIncrSchemaVerOpHist.Observe(time.Since(start).Seconds()) - }() - return schemaVersion, err + return jobCtx.metaMut.GenSchemaVersion() } // lockSchemaVersion gets the lock to prevent the schema version from being updated.