From 4c13945c370b98b69886c6bcd1e71d4934344cae Mon Sep 17 00:00:00 2001 From: valentinogeron Date: Mon, 21 Dec 2020 15:40:20 +0200 Subject: [PATCH] Fix PFDEBUG commands flag (#8222) - Mark it as a @hyperloglog command (ACL) - Should not be allowed in OOM - Add firstkey, lastkey, step - Add comment that explains the 'write' flag --- src/server.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/server.c b/src/server.c index de7e2736d..279e75f2a 100644 --- a/src/server.c +++ b/src/server.c @@ -975,9 +975,12 @@ struct redisCommand redisCommandTable[] = { "write use-memory @hyperloglog", 0,NULL,1,-1,1,0,0,0}, + /* Unlike PFCOUNT that is considered as a read-only command (although + * it changes a bit), PFDEBUG may change the entire key when converting + * from sparse to dense representation */ {"pfdebug",pfdebugCommand,-3, - "admin write", - 0,NULL,0,0,0,0,0,0}, + "admin write use-memory @hyperloglog", + 0,NULL,2,2,1,0,0,0}, {"xadd",xaddCommand,-5, "write use-memory fast random @stream",