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.
This commit is contained in:
antirez 2014-04-14 15:56:30 +02:00
parent ba0afb4566
commit 3bc35f9ce9

View File

@ -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;