Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ func clusterSlotInfoSliceParser(cn *conn, n int64) (interface{}, error) {
if err != nil {
return nil, err
}
if n != 2 {
return nil, fmt.Errorf("got %d elements in cluster info address, expected 2", n)
if n < 2 {
return nil, fmt.Errorf("got %d elements in cluster info address, expected at least 2", n)
}

ip, err := readStringReply(cn)
Expand All @@ -618,6 +618,16 @@ func clusterSlotInfoSliceParser(cn *conn, n int64) (interface{}, error) {
return nil, err
}

// IGNORE MSG
// FIX NEWER VERSION's ADDED INFO
// https://redis.io/commands/cluster-slots#Warnings
for i := int64(2); i < n; i++ {
_, err := readStringReply(cn)
if err != nil {
return nil, err
}
}

info.Addrs[i] = net.JoinHostPort(ip, strconv.FormatInt(port, 10))
}

Expand Down