From e1f3c89b3be10f0b52ea216e12dfe1fdad564ee8 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 31 May 2017 22:06:21 -0700 Subject: [PATCH] HBASE-18143 [AMv2] Backoff on failed report of region transition quickly goes to astronomical time scale M hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java Rather than compound the pause time, just have backoff multiple the original INIT_PAUSE_TIME_MS so we go 1, 2, 5, 10, ... etc. rather than 1, 2, 30, 600... and so on. Minor fixup around logging so report of failed transition is no longer reported as trace-level. --- .../hadoop/hbase/regionserver/HRegionServer.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 3ef26ce1657..ef99e47e17d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -2200,15 +2200,16 @@ public class HRegionServer extends HasThread implements ReportRegionStateTransitionResponse response = rss.reportRegionStateTransition(null, request); if (response.hasErrorMessage()) { - LOG.info("Failed transition " + hris[0] - + " to " + code + ": " + response.getErrorMessage()); + LOG.info("TRANSITION FAILED " + request + ": " + response.getErrorMessage()); + // NOTE: Return mid-method!!! return false; } // Log if we had to retry else don't log unless TRACE. We want to // know if were successful after an attempt showed in logs as failed. if (tries > 0 || LOG.isTraceEnabled()) { - LOG.trace("TRANSITION REPORTED " + request); + LOG.info("TRANSITION REPORTED " + request); } + // NOTE: Return mid-method!!! return true; } catch (ServiceException se) { IOException ioe = ProtobufUtil.getRemoteException(se); @@ -2216,11 +2217,11 @@ public class HRegionServer extends HasThread implements ioe instanceof PleaseHoldException; if (pause) { // Do backoff else we flood the Master with requests. - pauseTime = ConnectionUtils.getPauseTime(pauseTime, tries); + pauseTime = ConnectionUtils.getPauseTime(INIT_PAUSE_TIME_MS, tries); } else { pauseTime = INIT_PAUSE_TIME_MS; // Reset. } - LOG.info("Failed report of region transition " + + LOG.info("Failed report transition " + TextFormat.shortDebugString(request) + "; retry (#" + tries + ")" + (pause? " after " + pauseTime + "ms delay (Master is coming online...).": @@ -2233,9 +2234,7 @@ public class HRegionServer extends HasThread implements } } } - if (LOG.isTraceEnabled()) { - LOG.trace("TRANSITION NOT REPORTED " + request); - } + LOG.info("TRANSITION NOT REPORTED " + request); return false; }