From 4c3ac62191491c05b805b2e22789f34e9ae80c67 Mon Sep 17 00:00:00 2001 From: tidwall Date: Tue, 13 Nov 2018 12:04:16 -0700 Subject: [PATCH] Hotfix replica sync needs flushing --- internal/server/follow.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/server/follow.go b/internal/server/follow.go index aea9a2d9..69878c52 100644 --- a/internal/server/follow.go +++ b/internal/server/follow.go @@ -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()