Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 54751200B59 for ; Mon, 8 Aug 2016 21:13:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5258A160A91; Mon, 8 Aug 2016 19:13:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9B75D160A77 for ; Mon, 8 Aug 2016 21:13:13 +0200 (CEST) Received: (qmail 33671 invoked by uid 500); 8 Aug 2016 19:13:12 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 33662 invoked by uid 99); 8 Aug 2016 19:13:12 -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; Mon, 08 Aug 2016 19:13:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AD434DFC56; Mon, 8 Aug 2016 19:13:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: todd@apache.org To: commits@kudu.apache.org Message-Id: <28820cf5163940a4bb30fc590a05b843@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: kudu git commit: heartbeater: slight fixes to backoff behavior Date: Mon, 8 Aug 2016 19:13:12 +0000 (UTC) archived-at: Mon, 08 Aug 2016 19:13:14 -0000 Repository: kudu Updated Branches: refs/heads/master eaa15dea6 -> 935fa9236 heartbeater: slight fixes to backoff behavior 1. There was an off-by-one error when deciding how many failed heartbeats should lead to back off. 2. We only reset the connection to the master when transitioning to back off behavior, but I think the original intent was to reset it on every failed heartbeat thereafter. These changes shouldn't have any real impact, but I think they make the back off behavior more intuitive. Change-Id: I8f1dbc0a8b2d052eeb39277e0b8d76e612e9b747 Reviewed-on: http://gerrit.cloudera.org:8080/3847 Tested-by: Kudu Jenkins Reviewed-by: Todd Lipcon Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/935fa923 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/935fa923 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/935fa923 Branch: refs/heads/master Commit: 935fa923618922c1bd81957e471c7b49b442f000 Parents: eaa15de Author: Adar Dembo Authored: Fri Aug 5 13:29:49 2016 -0700 Committer: Todd Lipcon Committed: Mon Aug 8 19:13:05 2016 +0000 ---------------------------------------------------------------------- src/kudu/tserver/heartbeater.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/935fa923/src/kudu/tserver/heartbeater.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/heartbeater.cc b/src/kudu/tserver/heartbeater.cc index 166c91b..c0a1c85 100644 --- a/src/kudu/tserver/heartbeater.cc +++ b/src/kudu/tserver/heartbeater.cc @@ -326,7 +326,7 @@ int Heartbeater::Thread::GetMinimumHeartbeatMillis() const { << "in a row: no longer allowing fast heartbeat attempts."; } - return consecutive_failed_heartbeats_ > FLAGS_heartbeat_max_failures_before_backoff ? + return consecutive_failed_heartbeats_ >= FLAGS_heartbeat_max_failures_before_backoff ? FLAGS_heartbeat_interval_ms : 0; } @@ -458,7 +458,7 @@ void Heartbeater::Thread::RunThread() { // If we encountered a network error (e.g., connection // refused), try reconnecting. if (s.IsNetworkError() || - consecutive_failed_heartbeats_ == FLAGS_heartbeat_max_failures_before_backoff) { + consecutive_failed_heartbeats_ >= FLAGS_heartbeat_max_failures_before_backoff) { proxy_.reset(); } continue;