Skip to content

Commit

Permalink
redis-cli - sendReadOnly() to work with Redis Cloud (redis#13195)
Browse files Browse the repository at this point in the history
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 redis#12735 (not yet released).
  • Loading branch information
yveslb authored Apr 8, 2024
1 parent f4481e6 commit e3550f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/redis-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e3550f0

Please sign in to comment.