ddl: don't remove reorg info.
if we remove reorg info but don’t update the DDL status when crashed, another server will start a whole reorganization again.
This commit is contained in:
@ -319,7 +319,7 @@ func (d *ddl) backfillColumn(t table.Table, columnInfo *model.ColumnInfo, reorgI
|
||||
if err != nil {
|
||||
return errors.Trace(err)
|
||||
} else if len(handles) == 0 {
|
||||
return errors.Trace(reorgInfo.RemoveHandle())
|
||||
return nil
|
||||
}
|
||||
|
||||
seekHandle = handles[len(handles)-1] + 1
|
||||
@ -399,7 +399,7 @@ func (d *ddl) dropTableColumn(t table.Table, colInfo *model.ColumnInfo, reorgInf
|
||||
if err != nil {
|
||||
return errors.Trace(err)
|
||||
} else if len(handles) == 0 {
|
||||
return errors.Trace(reorgInfo.RemoveHandle())
|
||||
return nil
|
||||
}
|
||||
|
||||
seekHandle = handles[len(handles)-1] + 1
|
||||
|
||||
@ -345,7 +345,7 @@ func (d *ddl) addTableIndex(t table.Table, indexInfo *model.IndexInfo, reorgInfo
|
||||
if err != nil {
|
||||
return errors.Trace(err)
|
||||
} else if len(handles) == 0 {
|
||||
return errors.Trace(reorgInfo.RemoveHandle())
|
||||
return nil
|
||||
}
|
||||
|
||||
seekHandle = handles[len(handles)-1] + 1
|
||||
|
||||
@ -237,12 +237,3 @@ func (r *reorgInfo) UpdateHandle(txn kv.Transaction, handle int64) error {
|
||||
t := meta.NewMeta(txn)
|
||||
return errors.Trace(t.UpdateDDLReorgHandle(r.Job, handle))
|
||||
}
|
||||
|
||||
func (r *reorgInfo) RemoveHandle() error {
|
||||
err := kv.RunInNewTxn(r.d.store, true, func(txn kv.Transaction) error {
|
||||
t := meta.NewMeta(txn)
|
||||
err := t.RemoveDDLReorgHandle(r.Job)
|
||||
return errors.Trace(err)
|
||||
})
|
||||
return errors.Trace(err)
|
||||
}
|
||||
|
||||
@ -108,9 +108,6 @@ func (s *testDDLSuite) TestReorg(c *C) {
|
||||
return nil
|
||||
})
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
err = info.RemoveHandle()
|
||||
c.Assert(err, IsNil)
|
||||
}
|
||||
|
||||
func (s *testDDLSuite) TestReorgOwner(c *C) {
|
||||
|
||||
Reference in New Issue
Block a user