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

Signed-off-by: Mike Drob <mdrob@apache.org>
Signed-off-by: Umesh Agashe <uagashe@cloudera.com>
Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Wei-Chiu Chuang 2018-04-05 14:11:29 -07:00 committed by Mike Drob
parent a50d9f4351
commit b1901c9a15
1 changed files with 9 additions and 0 deletions

View File

@ -359,7 +359,16 @@ public class WALProcedureStore extends ProcedureStoreBase {
lock.lock(); lock.lock();
try { try {
LOG.trace("Starting WAL Procedure Store lease recovery"); LOG.trace("Starting WAL Procedure Store lease recovery");
boolean afterFirstAttempt = false;
while (isRunning()) { 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(); FileStatus[] oldLogs = getLogFiles();
// Get Log-MaxID and recover lease on old logs // Get Log-MaxID and recover lease on old logs
try { try {