You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2015/09/15 23:11:40 UTC

[04/10] cassandra git commit: Don't mark nodes down before the max local pause interval once paused.

Don't mark nodes down before the max local pause interval once paused.

Patch by brandonwilliams reviewed by Sankalp Kohli for CASSANDRA-9446


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/7fba3d29
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7fba3d29
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7fba3d29

Branch: refs/heads/trunk
Commit: 7fba3d299060f08bffbc9f58ee72df37ff28d8a5
Parents: c7b4073
Author: Brandon Williams <br...@apache.org>
Authored: Tue Sep 15 16:08:18 2015 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Tue Sep 15 16:08:18 2015 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/gms/FailureDetector.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7fba3d29/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/FailureDetector.java b/src/java/org/apache/cassandra/gms/FailureDetector.java
index a00cc33..58ad29f 100644
--- a/src/java/org/apache/cassandra/gms/FailureDetector.java
+++ b/src/java/org/apache/cassandra/gms/FailureDetector.java
@@ -49,7 +49,7 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
     private static final long DEFAULT_MAX_PAUSE = 5000L * 1000000L; // 5 seconds
     private static final long MAX_LOCAL_PAUSE_IN_NANOS = getMaxLocalPause();
     private long lastInterpret = System.nanoTime();
-    private boolean wasPaused = false;
+    private long lastPause = 0L;
 
     private static long getMaxLocalPause()
     {
@@ -247,12 +247,12 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
         if (diff > MAX_LOCAL_PAUSE_IN_NANOS)
         {
             logger.warn("Not marking nodes down due to local pause of {} > {}", diff, MAX_LOCAL_PAUSE_IN_NANOS);
-            wasPaused = true;
+            lastPause = now;
             return;
         }
-        if (wasPaused)
+        if (System.nanoTime() - lastPause < MAX_LOCAL_PAUSE_IN_NANOS)
         {
-            wasPaused = false;
+            logger.debug("Still not marking nodes down due to local pause");
             return;
         }
         double phi = hbWnd.phi(now);