diff options
author | antirez <antirez@gmail.com> | 2014-04-14 15:56:30 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-04-16 15:09:47 +0200 |
commit | 159926a170342fb69a003c39f37d52e6b8fee116 (patch) | |
tree | 073231ee20ec8cf5ea5b1d88a7a49745d21e5398 | |
parent | fc33779283b4b0e13ad970e56f500b0f3d0e8dfd (diff) | |
download | redis-159926a170342fb69a003c39f37d52e6b8fee116.tar.gz |
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.
-rw-r--r-- | src/hyperloglog.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c index b7c4b6cfe..fe0a5d7a0 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; |