Apache9 commented on a change in pull request #1311: HBASE-23984 [Flakey Tests] 
TestMasterAbortAndRSGotKilled fails in tea…
URL: https://github.com/apache/hbase/pull/1311#discussion_r395452954
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java
 ##########
 @@ -92,45 +91,41 @@ public RegionInfo getRegionInfo() {
   }
 
   @Override
-  public void process() {
-    try {
-      String name = regionInfo.getEncodedName();
-      LOG.trace("Processing close of {}", name);
-      String encodedRegionName = regionInfo.getEncodedName();
-      // Check that this region is being served here
-      HRegion region = (HRegion)rsServices.getRegion(encodedRegionName);
-      if (region == null) {
-        LOG.warn("Received CLOSE for region {} but currently not serving - 
ignoring", name);
-        // TODO: do better than a simple warning
-        return;
-      }
+  public void process() throws IOException {
+    String name = regionInfo.getEncodedName();
+    LOG.trace("Processing close of {}", name);
+    String encodedRegionName = regionInfo.getEncodedName();
+    // Check that this region is being served here
+    HRegion region = (HRegion)rsServices.getRegion(encodedRegionName);
+    if (region == null) {
+      LOG.warn("Received CLOSE for region {} but currently not serving - 
ignoring", name);
+      // TODO: do better than a simple warning
+      return;
+    }
+
+    // Close the region
+    if (region.close(abort) == null) {
+      // This region got closed.  Most likely due to a split.
+      // The split message will clean up the master state.
+      LOG.warn("Can't close region {}, was already closed during close()", 
name);
+      return;
+    }
 
-      // Close the region
-      try {
-        if (region.close(abort) == null) {
-          // This region got closed.  Most likely due to a split.
-          // The split message will clean up the master state.
-          LOG.warn("Can't close region {}, was already closed during close()", 
name);
-          return;
-        }
-      } catch (IOException ioe) {
-        // An IOException here indicates that we couldn't successfully flush 
the
-        // memstore before closing. So, we need to abort the server and allow
-        // the master to split our logs in order to recover the data.
-        server.abort("Unrecoverable exception while closing region " +
-          regionInfo.getRegionNameAsString() + ", still finishing close", ioe);
-        throw new RuntimeException(ioe);
-      }
+    this.rsServices.removeRegion(region, destination);
+    rsServices.reportRegionStateTransition(new 
RegionStateTransitionContext(TransitionCode.CLOSED,
+      HConstants.NO_SEQNUM, Procedure.NO_PROC_ID, -1, regionInfo));
 
-      this.rsServices.removeRegion(region, destination);
-      rsServices.reportRegionStateTransition(new 
RegionStateTransitionContext(TransitionCode.CLOSED,
-        HConstants.NO_SEQNUM, Procedure.NO_PROC_ID, -1, regionInfo));
+    // Done!  Region is closed on this RS
+    this.rsServices.getRegionsInTransitionInRS().
+      remove(this.regionInfo.getEncodedNameAsBytes(), Boolean.FALSE);
+    LOG.debug("Closed " + region.getRegionInfo().getRegionNameAsString());
 
 Review comment:
   LOG.debug("Closed {}", region.getRegionInfo().getRegionNameAsString());

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to