hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject hbase git commit: HBASE-16164 Missing close of new compacted segments in few occasions which might leak MSLAB chunks from pool.
Date Sat, 02 Jul 2016 06:12:31 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 561eb8296 -> 97f2294bf


HBASE-16164 Missing close of new compacted segments in few occasions which might leak MSLAB
chunks from pool.


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

Branch: refs/heads/master
Commit: 97f2294bfd17f7ae762d2e72ab0f25028b78f3fe
Parents: 561eb82
Author: anoopsjohn <anoopsamjohn@gmail.com>
Authored: Sat Jul 2 11:42:08 2016 +0530
Committer: anoopsjohn <anoopsamjohn@gmail.com>
Committed: Sat Jul 2 11:42:08 2016 +0530

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/CompactingMemStore.java  |  5 +++--
 .../hadoop/hbase/regionserver/CompactionPipeline.java  |  4 ++--
 .../hadoop/hbase/regionserver/MemStoreCompactor.java   | 13 ++++++++++---
 3 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/97f2294b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
index 0ca8af0..5e286de 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
@@ -203,8 +203,9 @@ public class CompactingMemStore extends AbstractMemStore {
     this.inMemoryFlushInProgress.set(inMemoryFlushInProgress);
   }
 
-  public void swapCompactedSegments(VersionedSegmentsList versionedList, ImmutableSegment
result) {
-    pipeline.swap(versionedList, result);
+  public boolean swapCompactedSegments(VersionedSegmentsList versionedList,
+      ImmutableSegment result) {
+    return pipeline.swap(versionedList, result);
   }
 
   public boolean hasCompactibleSegments() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/97f2294b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionPipeline.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionPipeline.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionPipeline.java
index 3ecd11c1..626fabf 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionPipeline.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionPipeline.java
@@ -86,7 +86,7 @@ public class CompactionPipeline {
    * @return true iff swapped tail with new compacted segment
    */
   public boolean swap(VersionedSegmentsList versionedList, ImmutableSegment segment) {
-    if(versionedList.getVersion() != version) {
+    if (versionedList.getVersion() != version) {
       return false;
     }
     LinkedList<ImmutableSegment> suffix;
@@ -103,7 +103,7 @@ public class CompactionPipeline {
       }
       swapSuffix(suffix,segment);
     }
-    if(region != null) {
+    if (region != null) {
       // update the global memstore size counter
       long suffixSize = CompactingMemStore.getSegmentsSize(suffix);
       long newSize = CompactingMemStore.getSegmentSize(segment);

http://git-wip-us.apache.org/repos/asf/hbase/blob/97f2294b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.java
index a363e95..d86cd32 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactor.java
@@ -135,9 +135,16 @@ class MemStoreCompactor {
 
       // Phase II: swap the old compaction pipeline
       if (!isInterrupted.get()) {
-        compactingMemStore.swapCompactedSegments(versionedList, result);
-        // update the wal so it can be truncated and not get too long
-        compactingMemStore.updateLowestUnflushedSequenceIdInWAL(true); // only if greater
+        if (compactingMemStore.swapCompactedSegments(versionedList, result)) {
+          // update the wal so it can be truncated and not get too long
+          compactingMemStore.updateLowestUnflushedSequenceIdInWAL(true); // only if greater
+        } else {
+          // We just ignored the Segment 'result' and swap did not happen.
+          result.close();
+        }
+      } else {
+        // We just ignore the Segment 'result'.
+        result.close();
       }
     } catch (Exception e) {
       LOG.debug("Interrupting the MemStore in-memory compaction for store " + compactingMemStore


Mime
View raw message