Cluster: process gossip section only for known nodes.
With the exception of nodes sending MEET packets: we have to trust them since they can send us MEET packets only when the cluster is initially created or because sysadmin manual action.
This commit is contained in:
parent
36e34a656a
commit
5f6950caa8
@ -1533,7 +1533,7 @@ int clusterProcessPacket(clusterLink *link) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process packets by type. */
|
/* Initial processing of PING and MEET requests replying with a PONG. */
|
||||||
if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_MEET) {
|
if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_MEET) {
|
||||||
redisLog(REDIS_DEBUG,"Ping packet received: %p", (void*)link->node);
|
redisLog(REDIS_DEBUG,"Ping packet received: %p", (void*)link->node);
|
||||||
|
|
||||||
@ -1571,14 +1571,17 @@ int clusterProcessPacket(clusterLink *link) {
|
|||||||
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get info from the gossip section */
|
/* If this is a MEET packet from an unknown node, we still process
|
||||||
|
* the gossip section here since we have to trust the sender because
|
||||||
|
* of the message type. */
|
||||||
|
if (!sender && type == CLUSTERMSG_TYPE_MEET)
|
||||||
clusterProcessGossipSection(hdr,link);
|
clusterProcessGossipSection(hdr,link);
|
||||||
|
|
||||||
/* Anyway reply with a PONG */
|
/* Anyway reply with a PONG */
|
||||||
clusterSendPing(link,CLUSTERMSG_TYPE_PONG);
|
clusterSendPing(link,CLUSTERMSG_TYPE_PONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PING or PONG: process config information. */
|
/* PING, PONG, MEET: process config information. */
|
||||||
if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_PONG ||
|
if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_PONG ||
|
||||||
type == CLUSTERMSG_TYPE_MEET)
|
type == CLUSTERMSG_TYPE_MEET)
|
||||||
{
|
{
|
||||||
@ -1775,7 +1778,7 @@ int clusterProcessPacket(clusterLink *link) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get info from the gossip section */
|
/* Get info from the gossip section */
|
||||||
clusterProcessGossipSection(hdr,link);
|
if (sender) clusterProcessGossipSection(hdr,link);
|
||||||
} else if (type == CLUSTERMSG_TYPE_FAIL) {
|
} else if (type == CLUSTERMSG_TYPE_FAIL) {
|
||||||
clusterNode *failing;
|
clusterNode *failing;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user