summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-14 15:56:30 +0200
committerantirez <antirez@gmail.com>2014-04-16 15:26:27 +0200
commit9ef8ef410b303641a65c10904904ed83235ee22e (patch)
treebb36e2a88ff56bba8d473cdb035182362e059b3a
parent91e05e1618a2db22b93d125d4f2b43daa6fe99d1 (diff)
downloadredis-9ef8ef410b303641a65c10904904ed83235ee22e.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.c9
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;