From 4ab45183fc8ad6f6448e869efacf537d5e0df1a1 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 31 Mar 2014 12:29:24 +0200 Subject: [PATCH] HLLCOUNT is technically a write command When we update the cached value, we need to propagate the command and signal the key as modified for WATCH. --- src/hyperloglog.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hyperloglog.c b/src/hyperloglog.c index 9b67c905b..70d61a161 100644 --- a/src/hyperloglog.c +++ b/src/hyperloglog.c @@ -522,6 +522,12 @@ void hllCountCommand(redisClient *c) { registers[REDIS_HLL_SIZE-3] = (card >> 40) & 0xff; registers[REDIS_HLL_SIZE-2] = (card >> 48) & 0xff; registers[REDIS_HLL_SIZE-1] = (card >> 56) & 0xff; + /* This is not considered a read-only command even if the + * data structure is not modified, since the cached value + * may be modified and given that the HLL is a Redis string + * we need to propagate the change. */ + signalModifiedKey(c->db,c->argv[1]); + server.dirty++; } addReplyLongLong(c,card); }