diff --git a/internal/utils/cluster_nodes.go b/internal/utils/cluster_nodes.go index 56d26b7d..eb27f3b3 100644 --- a/internal/utils/cluster_nodes.go +++ b/internal/utils/cluster_nodes.go @@ -46,6 +46,12 @@ func GetRedisClusterNodes(address string, username string, password string, Tls slot := make([]int, 0) for i := 8; i < len(words); i++ { words[i] = strings.TrimSpace(words[i]) + if strings.HasPrefix(words[i], "[") { + // issue: https://github.com/tair-opensource/RedisShake/issues/730 + // [****] appear at the end of each line of "cluster nodes", + // indicating data migration between nodes is in progress. + break + } var start, end int var err error if strings.Contains(words[i], "-") { @@ -69,8 +75,8 @@ func GetRedisClusterNodes(address string, username string, password string, Tls slot = append(slot, j) slotsCount++ } - slots = append(slots, slot) } + slots = append(slots, slot) } if slotsCount != 16384 { log.Panicf("invalid cluster nodes slots. slots_count=%v, address=%v", slotsCount, address)