summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-02-26 11:19:48 +0100
committerantirez <antirez@gmail.com>2013-02-26 11:19:48 +0100
commit1b1b3f6c068eab655c5c5e84891fe1970f36c923 (patch)
treeb85d3e96773f5e9561be9058474ed65d45173bb1
parentd5e8b0a47fa84debb9b0b5b2ce617b3739c04245 (diff)
downloadredis-1b1b3f6c068eab655c5c5e84891fe1970f36c923.tar.gz
Cluster: invert two functions declarations in more natural order.
-rw-r--r--src/cluster.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 897079c4c..2c0b5b08c 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -374,6 +374,26 @@ void clusterNodeAddFailureReport(clusterNode *failing, clusterNode *sender) {
listAddNodeTail(l,fr);
}
+/* 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. */
+void clusterNodeCleanupFailureReports(clusterNode *node) {
+ list *l = node->fail_reports;
+ listNode *ln;
+ listIter li;
+ clusterNodeFailReport *fr;
+ time_t maxtime = server.cluster->node_timeout*2;
+ time_t now = time(NULL);
+
+ listRewind(l,&li);
+ while ((ln = listNext(&li)) != NULL) {
+ fr = ln->value;
+ if (now - fr->time > maxtime) listDelNode(l,ln);
+ }
+}
+
/* Remove the failing report for 'node' if it was previously considered
* failing by 'sender'. This function is called when a node informs us via
* gossip that a node is OK from its point of view (no FAIL or PFAIL flags).
@@ -401,26 +421,6 @@ void clusterNodeDelFailureReport(clusterNode *node, clusterNode *sender) {
clusterNodeCleanupFailureReports(node);
}
-/* 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. */
-void clusterNodeCleanupFailureReports(clusterNode *node) {
- list *l = node->fail_reports;
- listNode *ln;
- listIter li;
- clusterNodeFailReport *fr;
- time_t maxtime = server.cluster->node_timeout*2;
- time_t now = time(NULL);
-
- listRewind(l,&li);
- while ((ln = listNext(&li)) != NULL) {
- fr = ln->value;
- if (now - fr->time > maxtime) listDelNode(l,ln);
- }
-}
-
/* Return the number of external nodes that believe 'node' is failing,
* not including this node, that may have a PFAIL or FAIL state for this
* node as well. */