Closed SS-TruMinds closed 2 years ago
Hi!
Probably hiredis-cluster tries to figure out to which node to send the command. Most commands contain a key and the command is sent to the node that has the key. My guess is that there is no such case for CLUSTER INFO.
Here is a workaround: Send the command to a specific node using redisClusterAsyncCommandToNode
, where the node is chosen in advance. For CLUSTER INFO it can be any node in cc->nodes
. (TODO: Add this to README, with examples how to iterate over it.)
In this test suite there are examples of sending commands to specific nodes and to all nodes in the cluster: https://github.com/Nordix/hiredis-cluster/blob/master/tests/ct_specific_nodes.c
Thank you.
In the meantime, we tried redisClusterAsyncCommandToNode
and it worked, so that is how we will proceed.
Thank you for the support.
Hi,
We are trying to issue 'cluster info' as follows:
int status = redisClusterAsyncCommand(cc, clusterInfoCallback, (char *)"THE_ID", "CLUSTER INFO");
This returns REDIS_ERR, with
cc->err
set to "Parse command error. Cmd type: 0, state: 5, break position: 15."What could be the issue here?
Thank you.