• antirez's avatar
    Better address udpate strategy when processing gossip sections. · 592419b4
    antirez authored
    The change covers the case where:
    
    1. There is a node we can't reach (in fail or pfail state).
    2. We see a different address for this node, in the gossip section sent
    to us by a node that, instead, is able to talk with the node we cannot
    talk to.
    
    In this case it's a good bet to switch to the address reported by this
    node, since there was an address switch and it is able to talk with the
    node and we are not.
    
    However previosuly this was done in a dangerous way, by initiating an
    handshake. The handshake, using the MEET packet, forces the receiver to
    join our cluster, and this is not a good idea. If the node in question
    really just switched address, but is the same node, it already knows about
    us, so we just need to perform an address update and a reconnection.
    
    So with this commit instead we just update the address of the node,
    release the node link if any, and attempt to reconnect in the next
    clusterCron() cycle.
    
    The commit also improves debugging messages printed by Cluster during
    address or ID switches.
    592419b4
cluster.c 200 KB