From d2a0348a490ab2f3edc07f9ba4098f6e06bfefd1 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 1 Feb 2013 15:05:43 +0100 Subject: [PATCH] SYNC not allowed with pending data on the static output buffer. --- src/replication.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/replication.c b/src/replication.c index ec36000b..4348dcfa 100644 --- a/src/replication.c +++ b/src/replication.c @@ -457,8 +457,8 @@ void syncCommand(redisClient *c) { * the client about already issued commands. We need a fresh reply * buffer registering the differences between the BGSAVE and the current * dataset, so that we can copy to other slaves if needed. */ - if (listLength(c->reply) != 0) { - addReplyError(c,"SYNC and PSYNC are invalid with pending input"); + if (listLength(c->reply) != 0 || c->bufpos != 0) { + addReplyError(c,"SYNC and PSYNC are invalid with pending output"); return; }