vipshop / hiredis-vip

Support redis cluster. Maintained and used at vipshop.
BSD 3-Clause "New" or "Revised" License
323 stars 173 forks source link

根据slots进行路由的方式初始化 ,由于cluster slots返回字段处理错误,导致创建连接失败 #72

Closed wenyuan-ma closed 6 years ago

wenyuan-ma commented 6 years ago

https://github.com/vipshop/hiredis-vip/blob/f12060498004494a3e1de11f653a8624f3d218c3/hircluster.c#L856 elem_nodes->elements != 2){ //Fixme ip:port array has two element

Fix this bug at here https://github.com/wenyuan-ma/hiredis-vip/pull/1/commits/58ac7d9108afff7ceb827fae3c9ca2d9fb1e5799

wenyuan-ma commented 6 years ago

这个对应的是redis 3.0.4 的版本协议 cluster slots 返回值中ip:port的数组是2个。 4.0中返回值是3个 1) 1) (integer) 0 2) (integer) 5460 3) 1) "172.24.8.210" 2) (integer) 7003 4) 1) "172.24.8.209" 2) (integer) 7000