From b1901c9a15fccba94f1750021d7d7c84dd60cc8b Mon Sep 17 00:00:00 2001 From: Wei-Chiu Chuang Date: Thu, 5 Apr 2018 14:11:29 -0700 Subject: [PATCH] HBASE-20338 WALProcedureStore#recoverLease() should have fixed sleeps for retrying rollWriter() Signed-off-by: Mike Drob Signed-off-by: Umesh Agashe Signed-off-by: Chia-Ping Tsai --- .../hbase/procedure2/store/wal/WALProcedureStore.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 d14e1bf0ff3..0c8cfd24403 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 {