Hotfix replica sync needs flushing

This commit is contained in:
tidwall 2018-11-13 12:04:16 -07:00
parent dfcdeb7a51
commit 4c3ac62191
1 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,9 @@ func (c *Server) followHandleCommand(args []string, followc int, w io.Writer) (i
if err := c.writeAOF(args, &d); err != nil {
return c.aofsz, err
}
if len(c.aofbuf) > 10240 {
c.flushAOF()
}
return c.aofsz, nil
}
@ -238,6 +241,7 @@ func (c *Server) followStep(host string, port int, followc int) error {
if aofsz >= int(aofSize) {
caughtUp = true
c.mu.Lock()
c.flushAOF()
c.fcup = true
c.fcuponce = true
c.mu.Unlock()