Repository: hbase
Updated Branches:
  refs/heads/branch-2 4f32883e9 -> f9790b01d


HBASE-21088 HStoreFile should be closed in HStore#hasReferences


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f9790b01
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f9790b01
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f9790b01

Branch: refs/heads/branch-2
Commit: f9790b01d9ffd9457abe33d8a65a0a467389f4d6
Parents: 4f32883
Author: tedyu <yuzhih...@gmail.com>
Authored: Mon Aug 27 09:38:03 2018 -0700
Committer: tedyu <yuzhih...@gmail.com>
Committed: Mon Aug 27 09:38:03 2018 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/HStore.java     | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f9790b01/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
index 1b95a77..ea699ea 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
@@ -1670,6 +1670,17 @@ public class HStore implements Store, HeapSize, 
StoreConfigInformation, Propagat
       LOG.error("Error trying to determine if store has references, assuming 
references exists",
         ioe);
       return true;
+    } finally {
+      if (reloadedStoreFiles != null) {
+        for (HStoreFile storeFile : reloadedStoreFiles) {
+          try {
+            storeFile.closeStoreFile(false);
+          } catch (IOException ioe) {
+            LOG.warn("Encountered exception closing " + storeFile + ": " + 
ioe.getMessage());
+            // continue with closing the remaining store files
+          }
+        }
+      }
     }
   }
 

Reply via email to