From 09e68a95e993d5e6dc9600879e8153ea4cab189e Mon Sep 17 00:00:00 2001 From: tangenta Date: Mon, 3 Jun 2024 18:26:54 +0800 Subject: [PATCH 1/3] This is an automated cherry-pick of #53720 Signed-off-by: ti-chi-bot --- pkg/ddl/BUILD.bazel | 5 ++ pkg/ddl/ddl.go | 9 ++-- pkg/ddl/ddl_api_test.go | 41 +++++++++++++++ pkg/ddl/job_table.go | 33 ++++++++++++ pkg/ddl/placement_policy.go | 4 +- pkg/ddl/schema.go | 2 +- pkg/ddl/table.go | 100 ++++++++++++++++++++++++++++++++++-- pkg/ddl/table_test.go | 3 +- 8 files changed, 183 insertions(+), 14 deletions(-) diff --git a/pkg/ddl/BUILD.bazel b/pkg/ddl/BUILD.bazel index 58e2a9e578855..8f5b0ff4735fc 100644 --- a/pkg/ddl/BUILD.bazel +++ b/pkg/ddl/BUILD.bazel @@ -149,7 +149,11 @@ go_library( "//pkg/util/slice", "//pkg/util/sqlexec", "//pkg/util/stringutil", +<<<<<<< HEAD "//pkg/util/syncutil", +======= + "//pkg/util/tiflash", +>>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) "//pkg/util/timeutil", "//pkg/util/topsql", "//pkg/util/topsql/state", @@ -315,6 +319,7 @@ go_test( "@com_github_tikv_client_go_v2//util", "@io_etcd_go_etcd_client_v3//:client", "@org_golang_google_grpc//:grpc", + "@org_golang_x_sync//errgroup", "@org_uber_go_atomic//:atomic", "@org_uber_go_goleak//:goleak", "@org_uber_go_zap//:zap", diff --git a/pkg/ddl/ddl.go b/pkg/ddl/ddl.go index e9e146c466dce..a42ba40f83490 100644 --- a/pkg/ddl/ddl.go +++ b/pkg/ddl/ddl.go @@ -64,8 +64,12 @@ import ( tidbutil "github.com/pingcap/tidb/pkg/util" "github.com/pingcap/tidb/pkg/util/dbterror" "github.com/pingcap/tidb/pkg/util/gcutil" +<<<<<<< HEAD "github.com/pingcap/tidb/pkg/util/logutil" "github.com/pingcap/tidb/pkg/util/syncutil" +======= + "github.com/pingcap/tidb/pkg/util/generic" +>>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) "github.com/tikv/client-go/v2/tikvrpc" clientv3 "go.etcd.io/etcd/client/v3" atomicutil "go.uber.org/atomic" @@ -365,11 +369,6 @@ type ddlCtx struct { // reorgCtx is used for reorganization. reorgCtx reorgContexts - // backfillCtx is used for backfill workers. - backfillCtx struct { - syncutil.RWMutex - jobCtxMap map[int64]*JobContext - } jobCtx struct { sync.RWMutex diff --git a/pkg/ddl/ddl_api_test.go b/pkg/ddl/ddl_api_test.go index fa1a4990d6e95..14b519d68bce7 100644 --- a/pkg/ddl/ddl_api_test.go +++ b/pkg/ddl/ddl_api_test.go @@ -31,6 +31,7 @@ import ( "github.com/pingcap/tidb/pkg/testkit" "github.com/pingcap/tidb/pkg/util/chunk" "github.com/stretchr/testify/require" + "golang.org/x/sync/errgroup" ) func TestGetDDLJobs(t *testing.T) { @@ -151,6 +152,46 @@ func enQueueDDLJobs(t *testing.T, sess session.Session, txn kv.Transaction, jobT } } +func TestCreateViewConcurrently(t *testing.T) { + store := testkit.CreateMockStore(t) + tk := testkit.NewTestKit(t, store) + tk.MustExec("use test") + + tk.MustExec("create table t (a int);") + tk.MustExec("create view v as select * from t;") + var ( + counterErr error + counter int + ) + failpoint.EnableCall("github.com/pingcap/tidb/pkg/ddl/onDDLCreateView", func(job *model.Job) { + counter++ + if counter > 1 { + counterErr = fmt.Errorf("create view job should not run concurrently") + return + } + }) + failpoint.EnableCall("github.com/pingcap/tidb/pkg/ddl/afterDelivery2Worker", func(job *model.Job) { + if job.Type == model.ActionCreateView { + counter-- + } + }) + var eg errgroup.Group + for i := 0; i < 5; i++ { + eg.Go(func() error { + newTk := testkit.NewTestKit(t, store) + _, err := newTk.Exec("use test") + if err != nil { + return err + } + _, err = newTk.Exec("create or replace view v as select * from t;") + return err + }) + } + err := eg.Wait() + require.NoError(t, err) + require.NoError(t, counterErr) +} + func TestCreateDropCreateTable(t *testing.T) { store, dom := testkit.CreateMockStoreAndDomain(t) tk := testkit.NewTestKit(t, store) diff --git a/pkg/ddl/job_table.go b/pkg/ddl/job_table.go index 60d38c911b728..c4abfd25a4913 100644 --- a/pkg/ddl/job_table.go +++ b/pkg/ddl/job_table.go @@ -367,6 +367,39 @@ func (d *ddl) delivery2worker(wk *worker, pool *workerPool, job *model.Job) { asyncNotify(d.ddlJobCh) metrics.DDLRunningJobCount.WithLabelValues(pool.tp().String()).Dec() }() +<<<<<<< HEAD +======= + + err := wk.HandleLocalDDLJob(d.ddlCtx, job) + pool.put(wk) + if err != nil { + logutil.DDLLogger().Info("handle ddl job failed", zap.Error(err), zap.Stringer("job", job)) + } + task.NotifyError(err) + }) +} + +// delivery2Worker owns the worker, need to put it back to the pool in this function. +func (s *jobScheduler) delivery2Worker(wk *worker, pool *workerPool, job *model.Job) { + injectFailPointForGetJob(job) + s.runningJobs.add(job) + s.wg.Run(func() { + metrics.DDLRunningJobCount.WithLabelValues(pool.tp().String()).Inc() + defer func() { + failpoint.InjectCall("afterDelivery2Worker", job) + s.runningJobs.remove(job) + asyncNotify(s.ddlJobNotifyCh) + metrics.DDLRunningJobCount.WithLabelValues(pool.tp().String()).Dec() + if wk.ctx.Err() != nil && ingest.LitBackCtxMgr != nil { + // if ctx cancelled, i.e. owner changed, we need to Unregister the backend + // as litBackendCtx is holding this very 'ctx', and it cannot reuse now. + // TODO make LitBackCtxMgr a local value of the job scheduler, it makes + // it much harder to test multiple owners in 1 unit test. + ingest.LitBackCtxMgr.Unregister(job.ID) + } + }() + ownerID := s.ownerManager.ID() +>>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) // check if this ddl job is synced to all servers. if !job.NotStarted() && (!d.isSynced(job) || !d.maybeAlreadyRunOnce(job.ID)) { if variable.EnableMDL.Load() { diff --git a/pkg/ddl/placement_policy.go b/pkg/ddl/placement_policy.go index 28cc053238c70..799da52e5efb3 100644 --- a/pkg/ddl/placement_policy.go +++ b/pkg/ddl/placement_policy.go @@ -119,7 +119,7 @@ func getPlacementPolicyByName(d *ddlCtx, t *meta.Meta, policyName model.CIStr) ( } is := d.infoCache.GetLatest() - if is.SchemaMetaVersion() == currVer { + if is != nil && is.SchemaMetaVersion() == currVer { // Use cached policy. policy, ok := is.PolicyByName(policyName) if ok { @@ -346,7 +346,7 @@ func checkPlacementPolicyNotInUse(d *ddlCtx, t *meta.Meta, policy *model.PolicyI return err } is := d.infoCache.GetLatest() - if is.SchemaMetaVersion() == currVer { + if is != nil && is.SchemaMetaVersion() == currVer { err = CheckPlacementPolicyNotInUseFromInfoSchema(is, policy) } else { err = CheckPlacementPolicyNotInUseFromMeta(t, policy) diff --git a/pkg/ddl/schema.go b/pkg/ddl/schema.go index e0425a5a9c618..81261b8d1d6b8 100644 --- a/pkg/ddl/schema.go +++ b/pkg/ddl/schema.go @@ -76,7 +76,7 @@ func checkSchemaNotExists(d *ddlCtx, t *meta.Meta, schemaID int64, dbInfo *model return err } is := d.infoCache.GetLatest() - if is.SchemaMetaVersion() == currVer { + if is != nil && is.SchemaMetaVersion() == currVer { return checkSchemaNotExistsFromInfoSchema(is, schemaID, dbInfo) } return checkSchemaNotExistsFromStore(t, schemaID, dbInfo) diff --git a/pkg/ddl/table.go b/pkg/ddl/table.go index df4d630b4e9f8..d9b3905cef827 100644 --- a/pkg/ddl/table.go +++ b/pkg/ddl/table.go @@ -274,14 +274,19 @@ func onCreateView(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error) schemaID := job.SchemaID tbInfo := &model.TableInfo{} var orReplace bool - var oldTbInfoID int64 - if err := job.DecodeArgs(tbInfo, &orReplace, &oldTbInfoID); err != nil { + var _placeholder int64 // oldTblInfoID + if err := job.DecodeArgs(tbInfo, &orReplace, &_placeholder); err != nil { // Invalid arguments, cancel this job. job.State = model.JobStateCancelled return ver, errors.Trace(err) } tbInfo.State = model.StateNone - err := checkTableNotExists(d, t, schemaID, tbInfo.Name.L) + + oldTableID, err := findTableIDByName(d, t, schemaID, tbInfo.Name.L) + if infoschema.ErrTableNotExists.Equal(err) { + err = nil + } + failpoint.InjectCall("onDDLCreateView", job) if err != nil { if infoschema.ErrDatabaseNotExists.Equal(err) { job.State = model.JobStateCancelled @@ -303,13 +308,18 @@ func onCreateView(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error) // none -> public tbInfo.State = model.StatePublic tbInfo.UpdateTS = t.StartTS +<<<<<<< HEAD if oldTbInfoID > 0 && orReplace { err = t.DropTableOrView(schemaID, oldTbInfoID) +======= + if oldTableID > 0 && orReplace { + err = t.DropTableOrView(schemaID, job.SchemaName, oldTableID, tbInfo.Name.L) +>>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) if err != nil { job.State = model.JobStateCancelled return ver, errors.Trace(err) } - err = t.GetAutoIDAccessors(schemaID, oldTbInfoID).Del() + err = t.GetAutoIDAccessors(schemaID, oldTableID).Del() if err != nil { job.State = model.JobStateCancelled return ver, errors.Trace(err) @@ -1473,13 +1483,51 @@ func checkTableNotExists(d *ddlCtx, t *meta.Meta, schemaID int64, tableName stri return err } is := d.infoCache.GetLatest() - if is.SchemaMetaVersion() == currVer { + if is != nil && is.SchemaMetaVersion() == currVer { return checkTableNotExistsFromInfoSchema(is, schemaID, tableName) } return checkTableNotExistsFromStore(t, schemaID, tableName) } +<<<<<<< HEAD +======= +func checkTableNotExistsByName(d *ddlCtx, t *meta.Meta, schemaID int64, schemaName, tableName string) error { + // Try to use memory schema info to check first. + currVer, err := t.GetSchemaVersion() + if err != nil { + return err + } + is := d.infoCache.GetLatest() + if is != nil && is.SchemaMetaVersion() == currVer { + return checkTableNotExistsFromInfoSchema(is, schemaID, tableName) + } + return t.CheckTableNameNotExists(t.TableNameKey(schemaName, tableName)) +} + +func checkConstraintNamesNotExists(t *meta.Meta, schemaID int64, constraints []*model.ConstraintInfo) error { + if len(constraints) == 0 { + return nil + } + tbInfos, err := t.ListTables(schemaID) + if err != nil { + return err + } + + for _, tb := range tbInfos { + for _, constraint := range constraints { + if constraint.State != model.StateWriteOnly { + if constraintInfo := tb.FindConstraintInfoByName(constraint.Name.L); constraintInfo != nil { + return infoschema.ErrCheckConstraintDupName.GenWithStackByArgs(constraint.Name.L) + } + } + } + } + + return nil +} + +>>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) func checkTableIDNotExists(t *meta.Meta, schemaID, tableID int64) error { tbl, err := t.GetTable(schemaID, tableID) if err != nil { @@ -1526,6 +1574,48 @@ func checkTableNotExistsFromStore(t *meta.Meta, schemaID int64, tableName string return nil } +func findTableIDByName(d *ddlCtx, t *meta.Meta, schemaID int64, tableName string) (int64, error) { + // Try to use memory schema info to check first. + currVer, err := t.GetSchemaVersion() + if err != nil { + return 0, err + } + is := d.infoCache.GetLatest() + if is != nil && is.SchemaMetaVersion() == currVer { + return findTableIDFromInfoSchema(is, schemaID, tableName) + } + + return findTableIDFromStore(t, schemaID, tableName) +} + +func findTableIDFromInfoSchema(is infoschema.InfoSchema, schemaID int64, tableName string) (int64, error) { + schema, ok := is.SchemaByID(schemaID) + if !ok { + return 0, infoschema.ErrDatabaseNotExists.GenWithStackByArgs("") + } + tbl, err := is.TableByName(schema.Name, model.NewCIStr(tableName)) + if err != nil { + return 0, err + } + return tbl.Meta().ID, nil +} + +func findTableIDFromStore(t *meta.Meta, schemaID int64, tableName string) (int64, error) { + tbls, err := t.ListSimpleTables(schemaID) + if err != nil { + if meta.ErrDBNotExists.Equal(err) { + return 0, infoschema.ErrDatabaseNotExists.GenWithStackByArgs("") + } + return 0, errors.Trace(err) + } + for _, tbl := range tbls { + if tbl.Name.L == tableName { + return tbl.ID, nil + } + } + return 0, infoschema.ErrTableNotExists.FastGenByArgs(tableName) +} + // updateVersionAndTableInfoWithCheck checks table info validate and updates the schema version and the table information func updateVersionAndTableInfoWithCheck(d *ddlCtx, t *meta.Meta, job *model.Job, tblInfo *model.TableInfo, shouldUpdateVer bool, multiInfos ...schemaIDAndTableInfo) ( ver int64, err error) { diff --git a/pkg/ddl/table_test.go b/pkg/ddl/table_test.go index 17e2f8698288b..4e811c5da75ed 100644 --- a/pkg/ddl/table_test.go +++ b/pkg/ddl/table_test.go @@ -309,7 +309,8 @@ func TestCreateView(t *testing.T) { } ctx.SetValue(sessionctx.QueryString, "skip") err = d.DoDDLJob(ctx, job) - require.Error(t, err) + // The non-existing table id in job args will not be considered anymore. + require.NoError(t, err) } func checkTableCacheTest(t *testing.T, store kv.Storage, dbInfo *model.DBInfo, tblInfo *model.TableInfo) { From 8cf99af554741318008a9b97d32f5bb7868be5c9 Mon Sep 17 00:00:00 2001 From: tangenta Date: Mon, 22 Jul 2024 13:43:35 +0800 Subject: [PATCH 2/3] resolve conflicts --- pkg/ddl/BUILD.bazel | 4 ---- pkg/ddl/ddl.go | 5 ---- pkg/ddl/ddl_api_test.go | 8 +++---- pkg/ddl/job_table.go | 39 +++++-------------------------- pkg/ddl/table.go | 52 ++++++----------------------------------- 5 files changed, 17 insertions(+), 91 deletions(-) diff --git a/pkg/ddl/BUILD.bazel b/pkg/ddl/BUILD.bazel index 8f5b0ff4735fc..a627e6af6efad 100644 --- a/pkg/ddl/BUILD.bazel +++ b/pkg/ddl/BUILD.bazel @@ -149,11 +149,7 @@ go_library( "//pkg/util/slice", "//pkg/util/sqlexec", "//pkg/util/stringutil", -<<<<<<< HEAD "//pkg/util/syncutil", -======= - "//pkg/util/tiflash", ->>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) "//pkg/util/timeutil", "//pkg/util/topsql", "//pkg/util/topsql/state", diff --git a/pkg/ddl/ddl.go b/pkg/ddl/ddl.go index a42ba40f83490..5c037b96d1242 100644 --- a/pkg/ddl/ddl.go +++ b/pkg/ddl/ddl.go @@ -64,12 +64,7 @@ import ( tidbutil "github.com/pingcap/tidb/pkg/util" "github.com/pingcap/tidb/pkg/util/dbterror" "github.com/pingcap/tidb/pkg/util/gcutil" -<<<<<<< HEAD "github.com/pingcap/tidb/pkg/util/logutil" - "github.com/pingcap/tidb/pkg/util/syncutil" -======= - "github.com/pingcap/tidb/pkg/util/generic" ->>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) "github.com/tikv/client-go/v2/tikvrpc" clientv3 "go.etcd.io/etcd/client/v3" atomicutil "go.uber.org/atomic" diff --git a/pkg/ddl/ddl_api_test.go b/pkg/ddl/ddl_api_test.go index 14b519d68bce7..1a620ce6714ce 100644 --- a/pkg/ddl/ddl_api_test.go +++ b/pkg/ddl/ddl_api_test.go @@ -163,18 +163,18 @@ func TestCreateViewConcurrently(t *testing.T) { counterErr error counter int ) - failpoint.EnableCall("github.com/pingcap/tidb/pkg/ddl/onDDLCreateView", func(job *model.Job) { + ddl.OnDDLCreateViewForTest = func(job *model.Job) { counter++ if counter > 1 { counterErr = fmt.Errorf("create view job should not run concurrently") return } - }) - failpoint.EnableCall("github.com/pingcap/tidb/pkg/ddl/afterDelivery2Worker", func(job *model.Job) { + } + ddl.AfterDeliverToWorkerForTest = func(job *model.Job) { if job.Type == model.ActionCreateView { counter-- } - }) + } var eg errgroup.Group for i := 0; i < 5; i++ { eg.Go(func() error { diff --git a/pkg/ddl/job_table.go b/pkg/ddl/job_table.go index c4abfd25a4913..da4379e54a863 100644 --- a/pkg/ddl/job_table.go +++ b/pkg/ddl/job_table.go @@ -356,6 +356,9 @@ func (d *ddl) loadDDLJobAndRun(se *sess.Session, pool *workerPool, getJob func(* d.delivery2worker(wk, pool, job) } +// AfterDeliverToWorkerForTest is only used for test. +var AfterDeliverToWorkerForTest func(*model.Job) + // delivery2worker owns the worker, need to put it back to the pool in this function. func (d *ddl) delivery2worker(wk *worker, pool *workerPool, job *model.Job) { injectFailPointForGetJob(job) @@ -363,43 +366,13 @@ func (d *ddl) delivery2worker(wk *worker, pool *workerPool, job *model.Job) { d.wg.Run(func() { metrics.DDLRunningJobCount.WithLabelValues(pool.tp().String()).Inc() defer func() { + if AfterDeliverToWorkerForTest != nil { + AfterDeliverToWorkerForTest(job) + } d.runningJobs.remove(job) asyncNotify(d.ddlJobCh) metrics.DDLRunningJobCount.WithLabelValues(pool.tp().String()).Dec() }() -<<<<<<< HEAD -======= - - err := wk.HandleLocalDDLJob(d.ddlCtx, job) - pool.put(wk) - if err != nil { - logutil.DDLLogger().Info("handle ddl job failed", zap.Error(err), zap.Stringer("job", job)) - } - task.NotifyError(err) - }) -} - -// delivery2Worker owns the worker, need to put it back to the pool in this function. -func (s *jobScheduler) delivery2Worker(wk *worker, pool *workerPool, job *model.Job) { - injectFailPointForGetJob(job) - s.runningJobs.add(job) - s.wg.Run(func() { - metrics.DDLRunningJobCount.WithLabelValues(pool.tp().String()).Inc() - defer func() { - failpoint.InjectCall("afterDelivery2Worker", job) - s.runningJobs.remove(job) - asyncNotify(s.ddlJobNotifyCh) - metrics.DDLRunningJobCount.WithLabelValues(pool.tp().String()).Dec() - if wk.ctx.Err() != nil && ingest.LitBackCtxMgr != nil { - // if ctx cancelled, i.e. owner changed, we need to Unregister the backend - // as litBackendCtx is holding this very 'ctx', and it cannot reuse now. - // TODO make LitBackCtxMgr a local value of the job scheduler, it makes - // it much harder to test multiple owners in 1 unit test. - ingest.LitBackCtxMgr.Unregister(job.ID) - } - }() - ownerID := s.ownerManager.ID() ->>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) // check if this ddl job is synced to all servers. if !job.NotStarted() && (!d.isSynced(job) || !d.maybeAlreadyRunOnce(job.ID)) { if variable.EnableMDL.Load() { diff --git a/pkg/ddl/table.go b/pkg/ddl/table.go index d9b3905cef827..6f80c31f32548 100644 --- a/pkg/ddl/table.go +++ b/pkg/ddl/table.go @@ -270,6 +270,9 @@ func repairTableOrViewWithCheck(t *meta.Meta, job *model.Job, schemaID int64, tb return t.UpdateTable(schemaID, tbInfo) } +// OnDDLCreateViewForTest is only used for test. +var OnDDLCreateViewForTest func(*model.Job) + func onCreateView(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error) { schemaID := job.SchemaID tbInfo := &model.TableInfo{} @@ -286,7 +289,9 @@ func onCreateView(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error) if infoschema.ErrTableNotExists.Equal(err) { err = nil } - failpoint.InjectCall("onDDLCreateView", job) + if OnDDLCreateViewForTest != nil { + OnDDLCreateViewForTest(job) + } if err != nil { if infoschema.ErrDatabaseNotExists.Equal(err) { job.State = model.JobStateCancelled @@ -308,13 +313,8 @@ func onCreateView(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error) // none -> public tbInfo.State = model.StatePublic tbInfo.UpdateTS = t.StartTS -<<<<<<< HEAD - if oldTbInfoID > 0 && orReplace { - err = t.DropTableOrView(schemaID, oldTbInfoID) -======= if oldTableID > 0 && orReplace { - err = t.DropTableOrView(schemaID, job.SchemaName, oldTableID, tbInfo.Name.L) ->>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) + err = t.DropTableOrView(schemaID, oldTableID) if err != nil { job.State = model.JobStateCancelled return ver, errors.Trace(err) @@ -1490,44 +1490,6 @@ func checkTableNotExists(d *ddlCtx, t *meta.Meta, schemaID int64, tableName stri return checkTableNotExistsFromStore(t, schemaID, tableName) } -<<<<<<< HEAD -======= -func checkTableNotExistsByName(d *ddlCtx, t *meta.Meta, schemaID int64, schemaName, tableName string) error { - // Try to use memory schema info to check first. - currVer, err := t.GetSchemaVersion() - if err != nil { - return err - } - is := d.infoCache.GetLatest() - if is != nil && is.SchemaMetaVersion() == currVer { - return checkTableNotExistsFromInfoSchema(is, schemaID, tableName) - } - return t.CheckTableNameNotExists(t.TableNameKey(schemaName, tableName)) -} - -func checkConstraintNamesNotExists(t *meta.Meta, schemaID int64, constraints []*model.ConstraintInfo) error { - if len(constraints) == 0 { - return nil - } - tbInfos, err := t.ListTables(schemaID) - if err != nil { - return err - } - - for _, tb := range tbInfos { - for _, constraint := range constraints { - if constraint.State != model.StateWriteOnly { - if constraintInfo := tb.FindConstraintInfoByName(constraint.Name.L); constraintInfo != nil { - return infoschema.ErrCheckConstraintDupName.GenWithStackByArgs(constraint.Name.L) - } - } - } - } - - return nil -} - ->>>>>>> 44c9096efbc (ddl: get latest old table ID before replace view (#53720)) func checkTableIDNotExists(t *meta.Meta, schemaID, tableID int64) error { tbl, err := t.GetTable(schemaID, tableID) if err != nil { From cfa3a09d6326a9eb27bf9a486362cc91b30b6caf Mon Sep 17 00:00:00 2001 From: tangenta Date: Mon, 22 Jul 2024 14:04:50 +0800 Subject: [PATCH 3/3] update bazel --- pkg/ddl/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/ddl/BUILD.bazel b/pkg/ddl/BUILD.bazel index a627e6af6efad..8939d4f1185b1 100644 --- a/pkg/ddl/BUILD.bazel +++ b/pkg/ddl/BUILD.bazel @@ -149,7 +149,6 @@ go_library( "//pkg/util/slice", "//pkg/util/sqlexec", "//pkg/util/stringutil", - "//pkg/util/syncutil", "//pkg/util/timeutil", "//pkg/util/topsql", "//pkg/util/topsql/state",