Don't update node pong time via gossip.

This feature was implemented in the initial days of the Redis Cluster
implementaiton but is not a good idea at all.

1) It depends on clocks to be synchronized, that is already very bad.
2) Moreover it adds a bug where the pong time is updated via gossip so
no new PING is ever sent by the current node, with the effect of no PONG
received, no update of tables, no clearing of PFAIL flag.

In general to trust other nodes about the reachability of other nodes is
a broken distributed programming model.
This commit is contained in:
antirez 2013-08-26 16:16:25 +02:00
parent 6ae37b0e1d
commit 303dde3757

View File

@ -704,15 +704,8 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) {
/* Update our state accordingly to the gossip sections */ /* Update our state accordingly to the gossip sections */
node = clusterLookupNode(g->nodename); node = clusterLookupNode(g->nodename);
if (node != NULL) { if (node != NULL) {
/* We already know this node. Let's start updating the last /* We already know this node.
* time PONG figure if it is newer than our figure. Handle failure reports, only when the sender is a master. */
* Note that it's not a problem if we have a PING already
* in progress against this node. */
if (node->pong_received < (signed) ntohl(g->pong_received)) {
redisLog(REDIS_DEBUG,"Node pong_received updated by gossip");
node->pong_received = ntohl(g->pong_received);
}
/* Handle failure reports, only when the sender is a master. */
if (sender && sender->flags & REDIS_NODE_MASTER && if (sender && sender->flags & REDIS_NODE_MASTER &&
node != server.cluster->myself) node != server.cluster->myself)
{ {