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. */
| 852 | * older than the global node timeout, so we don't just trust the number |
| 853 | * of failure reports from other nodes. */ |
| 854 | void 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 |
no test coverage detected