diff --git a/br/pkg/lightning/restore/restore.go b/br/pkg/lightning/restore/restore.go index 6665bbecf0a4b..be5446f66d1f2 100644 --- a/br/pkg/lightning/restore/restore.go +++ b/br/pkg/lightning/restore/restore.go @@ -209,10 +209,9 @@ type Controller struct { tidbGlue glue.Glue pdCli pd.Client - alterTableLock sync.Mutex - sysVars map[string]string - tls *common.TLS - checkTemplate Template + sysVars map[string]string + tls *common.TLS + checkTemplate Template errorSummaries errorSummaries diff --git a/br/pkg/lightning/restore/table_restore.go b/br/pkg/lightning/restore/table_restore.go index d0afbc4cfac04..3d0c2a8602b76 100644 --- a/br/pkg/lightning/restore/table_restore.go +++ b/br/pkg/lightning/restore/table_restore.go @@ -752,7 +752,6 @@ func (tr *TableRestore) postProcess( // 3. alter table set auto_increment if cp.Status < checkpoints.CheckpointStatusAlteredAutoInc { - rc.alterTableLock.Lock() tblInfo := tr.tableInfo.Core var err error if tblInfo.ContainsAutoRandomBits() { @@ -777,7 +776,6 @@ func (tr *TableRestore) postProcess( err = rebaseGlobalAutoID(ctx, adjustIDBase(newBase), tr, tr.dbInfo.ID, tr.tableInfo.Core) } } - rc.alterTableLock.Unlock() saveCpErr := rc.saveStatusCheckpoint(ctx, tr.tableName, checkpoints.WholeTableEngineID, err, checkpoints.CheckpointStatusAlteredAutoInc) if err = firstErr(err, saveCpErr); err != nil { return false, err