mirror of https://github.com/tidwall/tile38.git
Merge branch 'collection-optz' of https://github.com/tidwall/tile38 into collection-optz
This commit is contained in:
commit
8a5b842e3c
|
@ -227,6 +227,7 @@ func (c *Server) followStep(host string, port int, followc int) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send the replication port to the leader
|
// Send the replication port to the leader
|
||||||
|
if err := func() error {
|
||||||
v, err := conn.Do("replconf", "listening-port", c.port)
|
v, err := conn.Do("replconf", "listening-port", c.port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -237,11 +238,20 @@ func (c *Server) followStep(host string, port int, followc int) error {
|
||||||
if v.String() != "OK" {
|
if v.String() != "OK" {
|
||||||
return errors.New("invalid response to replconf request")
|
return errors.New("invalid response to replconf request")
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
if strings.HasPrefix(err.Error(), "ERR unknown command") {
|
||||||
|
log.Warn("follow:", addr, ":replconf", "not available on leader")
|
||||||
|
} else {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if core.ShowDebugMessages {
|
if core.ShowDebugMessages {
|
||||||
log.Debug("follow:", addr, ":replconf")
|
log.Debug("follow:", addr, ":replconf")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
v, err = conn.Do("aof", pos)
|
v, err := conn.Do("aof", pos)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue