You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by li...@apache.org on 2015/03/19 03:11:22 UTC
hbase git commit: HBASE-13200 Improper configuration can leads to
endless lease recovery during failover (He Liangliang)
Repository: hbase
Updated Branches:
refs/heads/master f9a17edc2 -> 6709feeb6
HBASE-13200 Improper configuration can leads to endless lease recovery during failover (He Liangliang)
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6709feeb
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6709feeb
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6709feeb
Branch: refs/heads/master
Commit: 6709feeb650ddc44b4168e3250fdd98d113e472c
Parents: f9a17ed
Author: Liu Shaohui <li...@xiaomi.com>
Authored: Thu Mar 19 10:07:25 2015 +0800
Committer: Liu Shaohui <li...@xiaomi.com>
Committed: Thu Mar 19 10:07:25 2015 +0800
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/util/FSHDFSUtils.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/6709feeb/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
index 8bdac15..0fffcc6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
@@ -180,9 +180,11 @@ public class FSHDFSUtils extends FSUtils {
long firstPause = conf.getInt("hbase.lease.recovery.first.pause", 4000);
// This should be set to how long it'll take for us to timeout against primary datanode if it
// is dead. We set it to 61 seconds, 1 second than the default READ_TIMEOUT in HDFS, the
- // default value for DFS_CLIENT_SOCKET_TIMEOUT_KEY.
- long subsequentPause = conf.getInt("hbase.lease.recovery.dfs.timeout", 61 * 1000);
-
+ // default value for DFS_CLIENT_SOCKET_TIMEOUT_KEY. If recovery is still failing after this
+ // timeout, then further recovery will take liner backoff with this base, to avoid endless
+ // preemptions when this value is not properly configured.
+ long subsequentPauseBase = conf.getLong("hbase.lease.recovery.dfs.timeout", 61 * 1000);
+
Method isFileClosedMeth = null;
// whether we need to look for isFileClosed method
boolean findIsFileClosedMeth = true;
@@ -198,11 +200,11 @@ public class FSHDFSUtils extends FSUtils {
if (nbAttempt == 0) {
Thread.sleep(firstPause);
} else {
- // Cycle here until subsequentPause elapses. While spinning, check isFileClosed if
- // available (should be in hadoop 2.0.5... not in hadoop 1 though.
+ // Cycle here until (subsequentPause * nbAttempt) elapses. While spinning, check
+ // isFileClosed if available (should be in hadoop 2.0.5... not in hadoop 1 though.
long localStartWaiting = EnvironmentEdgeManager.currentTime();
while ((EnvironmentEdgeManager.currentTime() - localStartWaiting) <
- subsequentPause) {
+ subsequentPauseBase * nbAttempt) {
Thread.sleep(conf.getInt("hbase.lease.recovery.pause", 1000));
if (findIsFileClosedMeth) {
try {