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

Function clusterNodeCleanupFailureReports

src/cluster.cpp:893–907  ·  view source on GitHub ↗

Remove failure reports that are too old, where too old means reasonably * older than the global node timeout. Note that anyway for a node to be * flagged as FAIL we need to have a local PFAIL state that is at least * older than the global node timeout, so we don't just trust the number * of failure reports from other nodes. */

Source from the content-addressed store, hash-verified

891 * older than the global node timeout, so we don't just trust the number
892 * of failure reports from other nodes. */
893void clusterNodeCleanupFailureReports(clusterNode *node) {
894 list *l = node->fail_reports;
895 listNode *ln;
896 listIter li;
897 clusterNodeFailReport *fr;
898 mstime_t maxtime = g_pserver->cluster_node_timeout *
899 CLUSTER_FAIL_REPORT_VALIDITY_MULT;
900 mstime_t now = mstime();
901
902 listRewind(l,&li);
903 while ((ln = listNext(&li)) != NULL) {
904 fr = (clusterNodeFailReport*)ln->value;
905 if (now - fr->time > maxtime) listDelNode(l,ln);
906 }
907}
908
909/* Remove the failing report for 'node' if it was previously considered
910 * failing by 'sender'. This function is called when a node informs us via

Callers 2

Calls 4

listRewindFunction · 0.85
listNextFunction · 0.85
listDelNodeFunction · 0.85
mstimeFunction · 0.70

Tested by

no test coverage detected