Skip to content
This repository was archived by the owner on Jan 26, 2023. It is now read-only.
This repository was archived by the owner on Jan 26, 2023. It is now read-only.

IsNew is too precise #36

@jcjones

Description

@jcjones

In client.IsNew, we check to see that cluster info gives back a very specific set of data:

var infoMatchingNewNodes = clusterInfo{"fail", 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
clusterInfo, err := h.GetClusterInfo()
if err != nil {
return false, err
} else if *clusterInfo == infoMatchingNewNodes {
return true, nil
} else {
return false, nil
}
}

In production, sometimes there are cluster stats messages sent and received, which causes Attache to assume a new cluster member is not actually new.

The stats messages received should be ignored. In a functioning cluster, cluster members will send pings to this new node as it comes online to assess its status. That shouldn't cause Attache to declare it kaput.

10.1.12.83:20001> cluster info
cluster_state:fail
cluster_slots_assigned:0
cluster_slots_ok:0
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:1
cluster_size:0
cluster_current_epoch:0
cluster_my_epoch:0
cluster_stats_messages_pong_sent:2
cluster_stats_messages_sent:2
cluster_stats_messages_ping_received:2
cluster_stats_messages_received:2
10.1.12.85:20001> cluster info
cluster_state:fail
cluster_slots_assigned:0
cluster_slots_ok:0
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:1
cluster_size:0
cluster_current_epoch:0
cluster_my_epoch:0
cluster_stats_messages_pong_sent:6
cluster_stats_messages_sent:6
cluster_stats_messages_ping_received:6
cluster_stats_messages_received:6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions