Skip to content

Commit

Permalink
lightning: remove alter table lock (#50074) (#50118)
Browse files Browse the repository at this point in the history
close #50105
  • Loading branch information
ti-chi-bot authored Feb 2, 2024
1 parent ecfef69 commit 630e995
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 3 additions & 4 deletions br/pkg/lightning/importer/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,9 @@ type Controller struct {
db *sql.DB
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

Expand Down
2 changes: 0 additions & 2 deletions br/pkg/lightning/importer/table_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,6 @@ func (tr *TableImporter) postProcess(

// alter table set auto_increment
if cp.Status < checkpoints.CheckpointStatusAlteredAutoInc {
rc.alterTableLock.Lock()
tblInfo := tr.tableInfo.Core
var err error
if tblInfo.ContainsAutoRandomBits() {
Expand All @@ -968,7 +967,6 @@ func (tr *TableImporter) postProcess(
err = common.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, errors.Trace(err)
Expand Down

0 comments on commit 630e995

Please sign in to comment.