From 3bc35f9ce917c630c401b2ed0d56b3a51658a5e2 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 14 Apr 2014 15:56:30 +0200 Subject: [PATCH] Correctly replicate PFDEBUG GETREG. Even if it is a debugging command, make sure that when it forces a change in encoding, the command is propagated. --- src/hyperloglog.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hyperloglog.c b/src/hyperloglog.c index b7c4b6cf..fe0a5d7a 100644 --- a/src/hyperloglog.c +++ b/src/hyperloglog.c @@ -1306,9 +1306,12 @@ void pfdebugCommand(redisClient *c) { if (!strcasecmp(cmd,"getreg")) { if (c->argc != 3) goto arityerr; - if (hllSparseToDense(o) == REDIS_ERR) { - addReplyError(c,"HLL sparse encoding is corrupted"); - return; + if (hdr->encoding == HLL_SPARSE) { + if (hllSparseToDense(o) == REDIS_ERR) { + addReplyError(c,"HLL sparse encoding is corrupted"); + return; + } + server.dirty++; /* Force propagation on encoding change. */ } hdr = o->ptr;