wuxibin89 / redis-go-cluster

redis cluster client implementation in Go
Apache License 2.0
488 stars 145 forks source link

Fix bug with expected nr of elements on cluster nodes command #4

Closed g-leon closed 8 years ago

g-leon commented 8 years ago

CLUSTER NODES command returns ip, port AND a hash, not just ip and port as you expected. This error leads to clients unable to connect to cluster. Tested with Redis 3.2.1

wuxibin89 commented 8 years ago

hi leon, According to redis release note, they have changed CLUSTER SLOT output since 3.2.0 which contain the additional node ID. For backward compatibility reason, I fix this as follow:

-   if err != nil || len(t) != 2 {
+   if err != nil || len(t) < 2 {

Thanks for your feedback!