Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A3DE717E89 for ; Tue, 15 Sep 2015 21:11:37 +0000 (UTC) Received: (qmail 9641 invoked by uid 500); 15 Sep 2015 21:11:37 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 9525 invoked by uid 500); 15 Sep 2015 21:11:37 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 9493 invoked by uid 99); 15 Sep 2015 21:11:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Sep 2015 21:11:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 334C2E00DE; Tue, 15 Sep 2015 21:11:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: brandonwilliams@apache.org To: commits@cassandra.apache.org Date: Tue, 15 Sep 2015 21:11:37 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/10] cassandra git commit: Don't mark nodes down before the max local pause interval once paused. Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 c7b407357 -> 7fba3d299 refs/heads/cassandra-2.2 cd4a1e6ac -> 3b126fd5a refs/heads/cassandra-3.0 4c51b359e -> a54589e12 refs/heads/trunk d22703bfa -> 131e097a7 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/cassandra-2.1 Commit: 7fba3d299060f08bffbc9f58ee72df37ff28d8a5 Parents: c7b4073 Author: Brandon Williams Authored: Tue Sep 15 16:08:18 2015 -0500 Committer: Brandon Williams 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);