From e3550f01dde29d5d1eaa37dbb4533692c5680f06 Mon Sep 17 00:00:00 2001 From: Yves LeBras Date: Mon, 8 Apr 2024 01:12:57 -0700 Subject: [PATCH] redis-cli - sendReadOnly() to work with Redis Cloud (#13195) When using Redis Cloud, sendReadOnly() exit with `Error: ERR unknown command 'READONLY'`. It is impacting `--memkeys`, `--bigkeys`, `--hotkeys`, and will impact `--keystats`. Added one line to ignore this error. issue introduced in #12735 (not yet released). --- src/redis-cli.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index 0c9f088da53..78f531f87a5 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -9099,7 +9099,9 @@ static void sendReadOnly(void) { if (read_reply == NULL){ fprintf(stderr, "\nI/O error\n"); exit(1); - } else if (read_reply->type == REDIS_REPLY_ERROR && strcmp(read_reply->str, "ERR This instance has cluster support disabled") != 0) { + } else if (read_reply->type == REDIS_REPLY_ERROR && + strcmp(read_reply->str, "ERR This instance has cluster support disabled") != 0 && + strncmp(read_reply->str, "ERR unknown command", 19) != 0) { fprintf(stderr, "Error: %s\n", read_reply->str); exit(1); }