MCPcopy Create free account
hub / github.com/F-Stack/f-stack / clusterSendUpdate

Function clusterSendUpdate

app/redis-6.2.6/src/cluster.c:2763–2773  ·  view source on GitHub ↗

Send an UPDATE message to the specified link carrying the specified 'node' * slots configuration. The node name, slots bitmap, and configEpoch info * are included. */

Source from the content-addressed store, hash-verified

2761 * slots configuration. The node name, slots bitmap, and configEpoch info
2762 * are included. */
2763void clusterSendUpdate(clusterLink *link, clusterNode *node) {
2764 clusterMsg buf[1];
2765 clusterMsg *hdr = (clusterMsg*) buf;
2766
2767 if (link == NULL) return;
2768 clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_UPDATE);
2769 memcpy(hdr->data.update.nodecfg.nodename,node->name,CLUSTER_NAMELEN);
2770 hdr->data.update.nodecfg.configEpoch = htonu64(node->configEpoch);
2771 memcpy(hdr->data.update.nodecfg.slots,node->slots,sizeof(node->slots));
2772 clusterSendMessage(link,(unsigned char*)buf,ntohl(hdr->totlen));
2773}
2774
2775/* Send a MODULE message.
2776 *

Callers 1

clusterProcessPacketFunction · 0.85

Calls 3

clusterBuildMessageHdrFunction · 0.85
clusterSendMessageFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected