From 5b53a187d26ac54b7cd2c3d4a011bcc02931de99 Mon Sep 17 00:00:00 2001 From: tedyu Date: Mon, 5 Jan 2015 15:05:35 -0800 Subject: [PATCH] HBASE-12793 [hbck] closeRegionSilentlyAndWait() should log cause of IOException and retry until hbase.hbck.close.timeout expires (Esteban) --- .../java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java | 5 ++++- .../java/org/apache/hadoop/hbase/util/TestHBaseFsck.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java index 666040869fe..0a0abda9b0a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java @@ -25,6 +25,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MetaTableAccessor; +import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.ZooKeeperConnectionException; @@ -167,7 +168,9 @@ public class HBaseFsckRepair { ProtobufUtil.getRegionInfo(rs, region.getRegionName()); if (rsRegion == null) return; } catch (IOException ioe) { - return; + if (ioe instanceof NotServingRegionException) // no need to retry again + return; + LOG.warn("Exception when retrieving regioninfo from: " + region.getRegionNameAsString(), ioe); } Thread.sleep(1000); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java index e13d7d42008..98753d07c6c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java @@ -154,6 +154,7 @@ public class TestHBaseFsck { conf.setInt("hbase.htable.threads.max", POOL_SIZE); conf.setInt("hbase.hconnection.threads.max", 2 * POOL_SIZE); conf.setInt("hbase.hconnection.threads.core", POOL_SIZE); + conf.setInt("hbase.hbck.close.timeout", 2 * REGION_ONLINE_TIMEOUT); TEST_UTIL.startMiniCluster(3); tableExecutorService = new ThreadPoolExecutor(1, POOL_SIZE, 60, TimeUnit.SECONDS,