Skip to content

Commit

Permalink
INFRA-6490 Indicate if redis node is disconnected in InstanceInfo
Browse files Browse the repository at this point in the history
This is used in joom-redis-health to detect is redis node was
disconnected (stopped). Stopped node does not always lead to replicaset
and/or cluster failure, and we should consider such nodes in
joom-terraform-apply health check.
  • Loading branch information
atikhono committed Apr 26, 2024
1 parent dda1344 commit 4117e3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rediscluster/redisclusterutil/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ type InstanceInfo struct {
// More probably, redis instance with other UUID were started on the same port.
NoAddr bool
SlaveOf string
Connected bool
Slots [][2]uint16
Migrating []SlotMigration
}
Expand Down Expand Up @@ -312,6 +313,7 @@ func ParseClusterNodes(res interface{}) (InstanceInfos, error) {
}
node.NoAddr = strings.Contains(parts[2], "noaddr")
node.MySelf = strings.Contains(parts[2], "myself")
node.Connected = parts[7] == "connected"

for _, slot := range parts[8:] {
if slot[0] == '[' {
Expand Down

0 comments on commit 4117e3e

Please # to comment.