sunhelly commented on code in PR #4568:
URL: https://github.com/apache/hbase/pull/4568#discussion_r905179377


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java:
##########
@@ -382,15 +379,25 @@ protected void requestCompactionInternal(HRegion region, 
HStore store, String wh
       // pool; we will do selection there, and move to large pool if necessary.
       pool = shortCompactions;
     }
-    pool.execute(
-      new CompactionRunner(store, region, compaction, tracker, 
completeTracker, pool, user));
-    if (LOG.isDebugEnabled()) {
-      LOG.debug(
-        "Add compact mark for store {}, priority={}, current under compaction "
-          + "store size is {}",
-        getStoreNameForUnderCompaction(store), priority, 
underCompactionStores.size());
-    }
+
+    // A simple implementation for under compaction marks.
+    // Since this method is always called in the synchronized methods, we do 
not need to use the
+    // boolean result to make sure that exactly the one that added here will 
be removed
+    // in the next steps.
     underCompactionStores.add(getStoreNameForUnderCompaction(store));
+    try {
+      pool.execute(
+        new CompactionRunner(store, region, compaction, tracker, 
completeTracker, pool, user));
+      if (LOG.isDebugEnabled()) {
+        LOG.debug(
+          "Add compact mark for store {}, priority={}, current under 
compaction "
+            + "store size is {}",
+          getStoreNameForUnderCompaction(store), priority, 
underCompactionStores.size());
+      }
+    } catch (Throwable t) {

Review Comment:
   Actually it will only throw NPE when pool.execute(null), which will never 
happen here. I think the 
underCompactionStores.add(getStoreNameForUnderCompaction(store)); can be put 
into the construct function of CompactionRunner, then the 'add' and 'remove' is 
a more clear pair.  Thanks.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to