Andrew Purtell created HBASE-12454:
--------------------------------------

             Summary: Setting didPerformCompaction early in HRegion#compact
                 Key: HBASE-12454
                 URL: https://issues.apache.org/jira/browse/HBASE-12454
             Project: HBase
          Issue Type: Bug
    Affects Versions: 0.98.8
            Reporter: Andrew Purtell


It appears we are setting 'didPerformCompaction' to "true" before attempting 
the compaction in HRegion#compact. If Store#compact throws an exception or is 
interrupted, we won't call Store#cancelRequestedCompaction in the last finally 
block of the method as it looks like we should.

{code}
--- 
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
@@ -1565,8 +1565,8 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver { //
         doRegionCompactionPrep();
         try {
           status.setStatus("Compacting store " + store);
-          didPerformCompaction = true;
           store.compact(compaction);
+          didPerformCompaction = true;
         } catch (InterruptedIOException iioe) {
           String msg = "compaction interrupted";
           LOG.info(msg, iioe);
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to