MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / clusterSendFail

Function clusterSendFail

src/cluster.cpp:2809–2816  ·  view source on GitHub ↗

Send a FAIL message to all the nodes we are able to contact. * The FAIL message is sent when we detect that a node is failing * (CLUSTER_NODE_PFAIL) and we also receive a gossip confirmation of this: * we switch the node state to CLUSTER_NODE_FAIL and ask all the other * nodes to do the same ASAP. */

Source from the content-addressed store, hash-verified

2807 * we switch the node state to CLUSTER_NODE_FAIL and ask all the other
2808 * nodes to do the same ASAP. */
2809void clusterSendFail(char *nodename) {
2810 clusterMsg buf[1];
2811 clusterMsg *hdr = (clusterMsg*) buf;
2812
2813 clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAIL);
2814 memcpy(hdr->data.fail.about.nodename,nodename,CLUSTER_NAMELEN);
2815 clusterBroadcastMessage(buf,ntohl(hdr->totlen));
2816}
2817
2818/* Send an UPDATE message to the specified link carrying the specified 'node'
2819 * slots configuration. The node name, slots bitmap, and configEpoch info

Callers 1

Calls 2

clusterBuildMessageHdrFunction · 0.85
clusterBroadcastMessageFunction · 0.85

Tested by

no test coverage detected