Skip to content

Commit

Permalink
lightning: remove alter table lock (#50074) (#50117)
Browse files Browse the repository at this point in the history
close #50105
  • Loading branch information
ti-chi-bot authored Feb 22, 2024
1 parent 63685fb commit 23052ef
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 @@ -208,10 +208,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 @@ -896,7 +896,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 @@ -921,7 +920,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, err
Expand Down

0 comments on commit 23052ef

Please sign in to comment.