diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java index 671fd7c..df8c609 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java @@ -2776,11 +2776,10 @@ public class AssignmentManager extends ZooKeeperListener { * @param hri * @param timeOut Milliseconds to wait for current region to be out of transition state. * @return True when a region clears regions-in-transition before timeout otherwise false - * @throws IOException * @throws InterruptedException */ public boolean waitOnRegionToClearRegionsInTransition(final HRegionInfo hri, long timeOut) - throws IOException, InterruptedException { + throws InterruptedException { if (!regionStates.isRegionInTransition(hri)) return true; RegionState rs = null; long end = (timeOut <= 0) ? Long.MAX_VALUE : EnvironmentEdgeManager.currentTimeMillis() diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java index 0782b66..48eb87c 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java @@ -89,7 +89,9 @@ public class MetaServerShutdownHandler extends ServerShutdownHandler { if (this.shouldSplitHlog && this.distributedLogReplay) { if (!am.waitOnRegionToClearRegionsInTransition(HRegionInfo.FIRST_META_REGIONINFO, regionAssignmentWaitTimeout)) { - throw new IOException("Region " + HRegionInfo.FIRST_META_REGIONINFO.getEncodedName() + // Wait here is to avoid log replay hits current dead server and incur a RPC timeout + // when replay happens before region assignment completes. + LOG.warn("Region " + HRegionInfo.FIRST_META_REGIONINFO.getEncodedName() + " didn't complete assignment in time"); } this.services.getMasterFileSystem().splitMetaLog(serverName); diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/ServerShutdownHandler.java hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/ServerShutdownHandler.java index 96e3ae0..040a5e4 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/ServerShutdownHandler.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/ServerShutdownHandler.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.master.handler; import java.io.IOException; +import java.io.InterruptedIOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -272,26 +273,25 @@ public class ServerShutdownHandler extends EventHandler { throw new IOException(ie); } - try { - if (this.shouldSplitHlog && this.distributedLogReplay) { - // wait for region assignment completes - for (HRegionInfo hri : toAssignRegions) { + if (this.shouldSplitHlog && this.distributedLogReplay) { + // wait for region assignment completes + for (HRegionInfo hri : toAssignRegions) { + try { if (!am.waitOnRegionToClearRegionsInTransition(hri, regionAssignmentWaitTimeout)) { - throw new IOException("Region " + hri.getEncodedName() + // Wait here is to avoid log replay hits current dead server and incur a RPC timeout + // when replay happens before region assignment completes. + LOG.warn("Region " + hri.getEncodedName() + " didn't complete assignment in time"); } + } catch (InterruptedException ie) { + throw new InterruptedIOException("Caught " + ie + + " during waitOnRegionToClearRegionsInTransition"); } - // submit logReplay work - this.services.getExecutorService().submit( - new LogReplayHandler(this.server, this.services, this.deadServers, this.serverName)); - hasLogReplayWork = true; - } - } catch (Exception ex) { - if (ex instanceof IOException) { - resubmit(serverName, (IOException)ex); - } else { - throw new IOException(ex); } + // submit logReplay work + this.services.getExecutorService().submit( + new LogReplayHandler(this.server, this.services, this.deadServers, this.serverName)); + hasLogReplayWork = true; } } finally { this.deadServers.finish(serverName);