diff options
author | Itamar Haber <itamar@redislabs.com> | 2017-11-24 19:58:37 +0200 |
---|---|---|
committer | Itamar Haber <itamar@redislabs.com> | 2017-11-24 19:58:37 +0200 |
commit | b28fb3d7530f7d682223e96ed88045f11dfef989 (patch) | |
tree | 8c1e9df63faae0b39fde7b627adc82be1190c022 /src | |
parent | 57bd8feb8d81064cd53a7f124e7509134fb7459b (diff) | |
download | redis-b28fb3d7530f7d682223e96ed88045f11dfef989.tar.gz |
Prevents `OBJECT freq` with `noeviction`
When maxmemory is set to noeviction, idletime is implicitly kept. This renders access frequency nonsensical.
Diffstat (limited to 'src')
-rw-r--r-- | src/object.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/object.c b/src/object.c index d2db7963e..bbf1ca110 100644 --- a/src/object.c +++ b/src/object.c @@ -1035,8 +1035,8 @@ void objectCommand(client *c) { } else if (!strcasecmp(c->argv[1]->ptr,"freq") && c->argc == 3) { if ((o = objectCommandLookupOrReply(c,c->argv[2],shared.nullbulk)) == NULL) return; - if (server.maxmemory_policy & MAXMEMORY_FLAG_LRU) { - addReplyError(c,"An LRU maxmemory policy is selected, access frequency not tracked. Please note that when switching between policies at runtime LRU and LFU data will take some time to adjust."); + if (!(server.maxmemory_policy & MAXMEMORY_FLAG_LFU)) { + addReplyError(c,"A non-LFU maxmemory policy is selected, access frequency not tracked. Please note that when switching between policies at runtime LRU and LFU data will take some time to adjust."); return; } addReplyLongLong(c,o->lru&255); |