summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-12-02 16:57:23 +0100
committerantirez <antirez@gmail.com>2014-12-02 16:57:23 +0100
commit8a7ccc58a16954a250fcb8f5ea6d184094d14653 (patch)
tree667b44d89c5d977ca040df55cd6ea25d1f3cffbc /src
parente07dd8b3e9adad705c238ee3ebb53d572c395d8e (diff)
downloadredis-8a7ccc58a16954a250fcb8f5ea6d184094d14653.tar.gz
Mark PFCOUNT as read-only, even if not true.
PFCOUNT is technically speaking a write command, since the cached value of the HLL is exposed in the data structure (design error, mea culpa), and can be modified by PFCOUNT. However if we flag PFCOUNT as "w", read only slaves can't execute the command, which is a problem since there are environments where slaves are used to scale PFCOUNT reads. Nor it is possible to just prevent PFCOUNT to modify the data structure in slaves, since without the cache we lose too much efficiency. So while this commit allows slaves to create a temporary inconsistency (the strings representing the HLLs in the master and slave can be different in certain moments) it is actually harmless. In the long run this should be probably fixed by turning the HLL into a more opaque representation, for example by storing the cached value in the part of the string which is not exposed (this should be possible with SDS strings).
Diffstat (limited to 'src')
-rw-r--r--src/redis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redis.c b/src/redis.c
index 83e0946ef..db6aff38b 100644
--- a/src/redis.c
+++ b/src/redis.c
@@ -280,7 +280,7 @@ struct redisCommand redisCommandTable[] = {
{"command",commandCommand,0,"rlt",0,NULL,0,0,0,0,0},
{"pfselftest",pfselftestCommand,1,"r",0,NULL,0,0,0,0,0},
{"pfadd",pfaddCommand,-2,"wmF",0,NULL,1,1,1,0,0},
- {"pfcount",pfcountCommand,-2,"w",0,NULL,1,1,1,0,0},
+ {"pfcount",pfcountCommand,-2,"r",0,NULL,1,1,1,0,0},
{"pfmerge",pfmergeCommand,-2,"wm",0,NULL,1,-1,1,0,0},
{"pfdebug",pfdebugCommand,-3,"w",0,NULL,0,0,0,0,0},
{"latency",latencyCommand,-2,"arslt",0,NULL,0,0,0,0,0}