提交 303dde37 编写于 作者: A antirez

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.
上级 6ae37b0e
...@@ -704,15 +704,8 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) { ...@@ -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)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册