Unverified Commit e3550f01 authored by Yves LeBras's avatar Yves LeBras Committed by GitHub
Browse files

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).
parent f4481e65
...@@ -9099,7 +9099,9 @@ static void sendReadOnly(void) { ...@@ -9099,7 +9099,9 @@ static void sendReadOnly(void) {
if (read_reply == NULL){ if (read_reply == NULL){
fprintf(stderr, "\nI/O error\n"); fprintf(stderr, "\nI/O error\n");
exit(1); 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); fprintf(stderr, "Error: %s\n", read_reply->str);
exit(1); exit(1);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment