• A
    Mark PFCOUNT as read-only, even if not true. · 0e40124d
    antirez 提交于
    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).
    0e40124d
redis.c 128.4 KB