From 303dde3757b75f9ce529ad804abf7e6d6ae5e793 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 26 Aug 2013 16:16:25 +0200 Subject: [PATCH] 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. --- src/cluster.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 3710db14..2afc62cc 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -704,15 +704,8 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) { /* Update our state accordingly to the gossip sections */ node = clusterLookupNode(g->nodename); if (node != NULL) { - /* We already know this node. Let's start updating the last - * time PONG figure if it is newer than our figure. - * 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. */ + /* We already know this node. + Handle failure reports, only when the sender is a master. */ if (sender && sender->flags & REDIS_NODE_MASTER && node != server.cluster->myself) {