diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 9c540c30655..ddfecef1cbc 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -543,6 +543,13 @@ public class HRegion implements HeapSize { // , Writable{ this.coprocessorHost = new RegionCoprocessorHost(this, rsServices, conf); this.metricsRegionWrapper = new MetricsRegionWrapperImpl(this); this.metricsRegion = new MetricsRegion(this.metricsRegionWrapper); + + Map recoveringRegions = rsServices.getRecoveringRegions(); + String encodedName = getRegionInfo().getEncodedName(); + if (recoveringRegions != null && recoveringRegions.containsKey(encodedName)) { + this.isRecovering = true; + recoveringRegions.put(encodedName, this); + } } else { this.metricsRegionWrapper = null; this.metricsRegion = null; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java index 22f869454cf..97ef25da639 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java @@ -19,7 +19,6 @@ package org.apache.hadoop.hbase.regionserver.handler; import java.io.IOException; -import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.logging.Log; @@ -142,15 +141,6 @@ public class OpenRegionHandler extends EventHandler { return; } - // check if we need set current region in recovering state - region.setRecovering(false); - Map recoveringRegions = this.rsServices.getRecoveringRegions(); - if (recoveringRegions != null && !recoveringRegions.isEmpty() - && recoveringRegions.containsKey(region.getRegionInfo().getEncodedName())) { - region.setRecovering(true); - recoveringRegions.put(region.getRegionInfo().getEncodedName(), region); - } - boolean failed = true; if (tickleOpening("post_region_open")) { if (updateMeta(region)) {