gh-ost/vendor/github.com/siddontang/go-mysql/failover/handler.go

23 lines
685 B
Go
Raw Normal View History

2017-02-12 11:13:54 +00:00
package failover
type Handler interface {
// Promote slave s to master
Promote(s *Server) error
// Change slave s to master m and replicate from it
ChangeMasterTo(s *Server, m *Server) error
// Ensure all relay log done, it will stop slave IO_THREAD
// You must start slave again if you want to do replication continuatively
WaitRelayLogDone(s *Server) error
// Wait until slave s catch all data from master m at current time
WaitCatchMaster(s *Server, m *Server) error
// Find best slave which has the most up-to-date data from master
FindBestSlaves(slaves []*Server) ([]*Server, error)
// Check all slaves have gtid enabled
CheckGTIDMode(slaves []*Server) error
}