Skip to content

Commit

Permalink
lightning: remove alter table lock (pingcap#50074)
Browse files Browse the repository at this point in the history
  • Loading branch information
D3Hunter authored and ti-chi-bot committed Jan 5, 2024
1 parent ae491e2 commit 72a4ef2
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 72a4ef2

Please sign in to comment.