Skip to content

Redis memory usage CLI does not work on cluster #7493

@alonana

Description

@alonana

I've posted this at stackoverflow, but got no response. I hope someone here would know the answer...

I using the go-redis library to check memory usage of a specific key on a Redis cluster. The library fails sporadically with error "redis: nil" which usually means that it accesses the wrong redis instance to find the key. The go-redis library is using the Redis CLI: "command" to get the list of arguments for each command, and to find where is the redis key position in the arguments list.

Specifically for the memory CLI, the output of the "command" CLI is:

157) 1) "memory"
     2) (integer) -2
     3) 1) readonly
        2) random
     4) (integer) 0
     5) (integer) 0
     6) (integer) 0

The Redis document: https://redis.io/commands/command items 4 and 5 are the positions of the first key in arguments, and the last key in arguments.

But the values are zero? According to the memory CLI document: https://redis.io/commands/memory-usage The items 4 and 5 should both have the value 3.

Is this a bug in the output of the redis "command" CLI, or am I misunderstanding this?

redis cluster-computing go-redis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions