informatikr / hedis

A Redis client library for Haskell.
http://hackage.haskell.org/package/hedis
BSD 3-Clause "New" or "Revised" License
330 stars 125 forks source link

add CLUSTER INFO command and use it for new checkedConnectCluster #185

Open stefanwire opened 2 years ago

stefanwire commented 2 years ago

Redis nodes in cluster mode can be pinged, but a successful pong from one cluster node would not determine whether the cluster and thus all its nodes are up and running. The cluster is up only if the CLUSTER INFO command reports cluster_state:ok.

This PR adds the CLUSTER INFO command and the checkedConnectCluster helper function for safely connecting to Redis clusters only when the cluster is up.

stefanwire commented 2 years ago

Related to https://github.com/informatikr/hedis/issues/183.

stefanwire commented 2 years ago

@jbrechtel, what do you think?

qnikst commented 1 year ago

Hello, @stefanwire! Thanks for your work and sorry for a late reply I've used your branch merged with latest master and tried to run cluster tests there. hedis-test-cluster just hangs for me...

If you are still interested in this issue and Redis cluster support can you take a look into that. Maybe I'm just running it in the wrong way.

I've run docker run -e "IP=0.0.0.0" -p 8000-8010:7000-7010 grokzen/redis-cluster:6.2.11, as 7000 is used my Control Centre application on MacOS, edited test to use port 8000 and started it.