kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject kudu git commit: heartbeater: slight fixes to backoff behavior
Date Mon, 08 Aug 2016 19:13:12 GMT
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 <todd@apache.org>


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 <adar@cloudera.com>
Authored: Fri Aug 5 13:29:49 2016 -0700
Committer: Todd Lipcon <todd@apache.org>
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;


Mime
View raw message