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

Function clusterNodeCleanupFailureReports

app/redis-6.2.6/src/cluster.c:854–868  ·  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

852 * older than the global node timeout, so we don't just trust the number
853 * of failure reports from other nodes. */
854void clusterNodeCleanupFailureReports(clusterNode *node) {
855 list *l = node->fail_reports;
856 listNode *ln;
857 listIter li;
858 clusterNodeFailReport *fr;
859 mstime_t maxtime = server.cluster_node_timeout *
860 CLUSTER_FAIL_REPORT_VALIDITY_MULT;
861 mstime_t now = mstime();
862
863 listRewind(l,&li);
864 while ((ln = listNext(&li)) != NULL) {
865 fr = ln->value;
866 if (now - fr->time > maxtime) listDelNode(l,ln);
867 }
868}
869
870/* Remove the failing report for 'node' if it was previously considered
871 * 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