ddl: remove the function of Start (#3288)

This commit is contained in:
Lynn
2017-05-18 11:12:50 +08:00
committed by GitHub
parent ff18bbf871
commit 7ff6a69ecf
2 changed files with 2 additions and 19 deletions

View File

@ -126,8 +126,6 @@ type DDL interface {
GetScope(status string) variable.ScopeFlag
// Stop stops DDL worker.
Stop() error
// Start starts DDL worker.
Start() error
// RegisterEventCh registers event channel for ddl.
RegisterEventCh(chan<- *Event)
}
@ -297,19 +295,6 @@ func (d *ddl) Stop() error {
return errors.Trace(err)
}
func (d *ddl) Start() error {
d.m.Lock()
defer d.m.Unlock()
if !d.isClosed() {
return nil
}
d.start()
return nil
}
func (d *ddl) start() {
d.quitCh = make(chan struct{})
d.wait.Add(2)

View File

@ -74,10 +74,8 @@ func (s *testDDLSuite) TestCheckOwner(c *C) {
d2.SetLease(1 * time.Second)
err := d2.Stop()
c.Assert(err, IsNil)
err = d1.Start()
c.Assert(err, IsNil)
err = d1.Start()
c.Assert(err, IsNil)
d1.start()
d2.start()
testCheckOwner(c, d1, true, ddlJobFlag)
testCheckOwner(c, d1, true, bgJobFlag)