HBASE-20338 WALProcedureStore#recoverLease() should have fixed sleeps for 
retrying rollWriter()

Signed-off-by: Mike Drob <md...@apache.org>
Signed-off-by: Umesh Agashe <uaga...@cloudera.com>
Signed-off-by: Chia-Ping Tsai <chia7...@gmail.com>


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

Branch: refs/heads/branch-2
Commit: b1901c9a15fccba94f1750021d7d7c84dd60cc8b
Parents: a50d9f4
Author: Wei-Chiu Chuang <weic...@cloudera.com>
Authored: Thu Apr 5 14:11:29 2018 -0700
Committer: Mike Drob <md...@apache.org>
Committed: Thu Apr 12 16:35:11 2018 -0500

----------------------------------------------------------------------
 .../hbase/procedure2/store/wal/WALProcedureStore.java       | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b1901c9a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
----------------------------------------------------------------------
diff --git 
a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
 
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
index d14e1bf..0c8cfd2 100644
--- 
a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
+++ 
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/WALProcedureStore.java
@@ -359,7 +359,16 @@ public class WALProcedureStore extends ProcedureStoreBase {
     lock.lock();
     try {
       LOG.trace("Starting WAL Procedure Store lease recovery");
+      boolean afterFirstAttempt = false;
       while (isRunning()) {
+        // Don't sleep before first attempt
+        if (afterFirstAttempt) {
+          LOG.trace("Sleep {} ms after first lease recovery attempt.",
+              waitBeforeRoll);
+          Threads.sleepWithoutInterrupt(waitBeforeRoll);
+        } else {
+          afterFirstAttempt = true;
+        }
         FileStatus[] oldLogs = getLogFiles();
         // Get Log-MaxID and recover lease on old logs
         try {

Reply via email to