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

Function clusterBroadcastPong

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

Source from the content-addressed store, hash-verified

2678#define CLUSTER_BROADCAST_ALL 0
2679#define CLUSTER_BROADCAST_LOCAL_SLAVES 1
2680void clusterBroadcastPong(int target) {
2681 dictIterator *di;
2682 dictEntry *de;
2683
2684 di = dictGetSafeIterator(server.cluster->nodes);
2685 while((de = dictNext(di)) != NULL) {
2686 clusterNode *node = dictGetVal(de);
2687
2688 if (!node->link) continue;
2689 if (node == myself || nodeInHandshake(node)) continue;
2690 if (target == CLUSTER_BROADCAST_LOCAL_SLAVES) {
2691 int local_slave =
2692 nodeIsSlave(node) && node->slaveof &&
2693 (node->slaveof == myself || node->slaveof == myself->slaveof);
2694 if (!local_slave) continue;
2695 }
2696 clusterSendPing(node->link,CLUSTERMSG_TYPE_PONG);
2697 }
2698 dictReleaseIterator(di);
2699}
2700
2701/* Send a PUBLISH message.
2702 *

Callers 3

clusterCommandFunction · 0.85

Calls 4

dictGetSafeIteratorFunction · 0.85
clusterSendPingFunction · 0.85
dictNextFunction · 0.70
dictReleaseIteratorFunction · 0.70

Tested by

no test coverage detected