Skip to content

Commit

Permalink
Improve the reliability of the refresh process due to the loss of slo…
Browse files Browse the repository at this point in the history
…t information
  • Loading branch information
fuyuan committed Oct 15, 2023
1 parent 5aef5f5 commit 8641598
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ func (c *Cluster) refresh(bg bool) error {
var errMsgs []string
var oldm, newm [HashSlots][]string

addrs, _ := c.getNodeAddrs(false)
// get all node addrs, including replicas
addrs, _ := c.getNodeAddrs(true)
// when addrs cannot be obtained, StartupNodes is always used to populate
if len(addrs) == 0 {
addrs = c.StartupNodes
}

for _, addr := range addrs {
m, err := c.getClusterSlots(addr)
if err != nil {
Expand Down

0 comments on commit 8641598

Please sign in to comment.