regionName
on sn
silently and immediately without
+ * using a Procedure or going via hbase:meta. For case where a RegionServer's hosting
+ * of a Region is not aligned w/ the Master's accounting of Region state. This is for
+ * cleaning up an error in accounting.
+ */
+ private void closeRegionSilently(ServerName sn, byte [] regionName) {
+ try {
+ RegionInfo ri = MetaTableAccessor.parseRegionInfoFromRegionName(regionName);
+ // Pass -1 for timeout. Means do not wait.
+ ServerManager.closeRegionSilentlyAndWait(this.master.getClusterConnection(), sn, ri, -1);
+ } catch (Exception e) {
+ LOG.error("Failed trying to close {} on {}", Bytes.toStringBinary(regionName), sn, e);
+ }
+ }
+
+ /**
+ * Check that what the RegionServer reports aligns with the Master's image.
+ * If disagreement, we will tell the RegionServer to expediently close
+ * a Region we do not think it should have.
+ */
private void checkOnlineRegionsReport(ServerStateNode serverNode, Set* If an opening was in progress, this method will cancel it, but will not start a new close. The @@ -3201,6 +3201,7 @@ public class HRegionServer extends HasThread implements } } + // previous can come back 'null' if not in map. final Boolean previous = this.regionsInTransitionInRS.putIfAbsent(Bytes.toBytes(encodedName), Boolean.FALSE); @@ -3222,6 +3223,8 @@ public class HRegionServer extends HasThread implements throw new NotServingRegionException("The region " + encodedName + " was opening but not yet served. Opening is cancelled."); } + } else if (previous == null) { + LOG.info("Received CLOSE for {}", encodedName); } else if (Boolean.FALSE.equals(previous)) { LOG.info("Received CLOSE for the region: " + encodedName + ", which we are already trying to CLOSE, but not completed yet");