Skip to content

Commit

Permalink
ddl: remove reorg ctx when current instance is not owner (#55050)
Browse files Browse the repository at this point in the history
close #54897
  • Loading branch information
tangenta authored Jul 30, 2024
1 parent d2304c8 commit 6990c1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/ddl/backfilling.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,12 @@ func (dc *ddlCtx) writePhysicalTableRecord(sessPool *sess.Pool, t table.Physical
totalAddedCount := job.GetRowCount()

startKey, endKey := reorgInfo.StartKey, reorgInfo.EndKey

if err := dc.isReorgRunnable(reorgInfo.Job.ID, false); err != nil {
if errors.ErrorEqual(err, dbterror.ErrNotOwner) {
// This instance is not DDL owner, we remove reorgctx proactively
// to avoid being used later.
dc.removeReorgCtx(reorgInfo.ID)
}
return errors.Trace(err)
}

Expand Down

0 comments on commit 6990c1f

Please sign in to comment.