hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-13473 deleted cells come back alive after the stripe compaction (jeongmin kim)
Date Thu, 16 Apr 2015 18:36:44 GMT
Repository: hbase
Updated Branches:
  refs/heads/master ddab4726f -> e08ef99e3


HBASE-13473 deleted cells come back alive after the stripe compaction (jeongmin kim)


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

Branch: refs/heads/master
Commit: e08ef99e3042767eaf2d11adae783674acfdddeb
Parents: ddab472
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Apr 16 11:36:25 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Apr 16 11:36:25 2015 -0700

----------------------------------------------------------------------
 .../regionserver/compactions/StripeCompactionPolicy.java |  2 +-
 .../compactions/TestStripeCompactionPolicy.java          | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e08ef99e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
index 5231662..0d49f09 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
@@ -248,7 +248,7 @@ public class StripeCompactionPolicy extends CompactionPolicy {
       req = new SplitStripeCompactionRequest(
           filesToCompact, si.getStartRow(bqIndex), si.getEndRow(bqIndex), targetCount, targetKvs);
     }
-    if (canDropDeletesWithoutL0 || includeL0) {
+    if (hasAllFiles && (canDropDeletesWithoutL0 || includeL0)) {
       req.setMajorRange(si.getStartRow(bqIndex), si.getEndRow(bqIndex));
     }
     req.getRequest().setOffPeak(isOffpeak);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e08ef99e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
index 81f8115..9350ce4 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
@@ -40,6 +40,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
 
 import org.apache.hadoop.conf.Configuration;
@@ -424,6 +425,16 @@ public class TestStripeCompactionPolicy {
     si = createStripesWithSizes(6, 2,
         new Long[][] { new Long[] { 10L, 1L, 1L, 1L, 1L }, new Long[] { 12L } });
     verifyCompaction(policy, si, si.getLevel0Files(), null, null, si.getStripeBoundaries());
+    // even if L0 has no file
+    // if all files of stripe aren't selected, delete must not be dropped.
+    stripes = new Long[][] { new Long[] { 100L, 3L, 2L, 2L, 2L }, new Long[] { 6L } };
+    si = createStripesWithSizes(0, 0, stripes);
+    List<StoreFile> compact_file = new ArrayList<StoreFile>();
+    Iterator<StoreFile> iter = si.getStripes().get(0).listIterator(1);
+    while (iter.hasNext()) {
+        compact_file.add(iter.next());
+    }
+    verifyCompaction(policy, si, compact_file, false, 1, null, si.getStartRow(0), si.getEndRow(0),
true);
   }
 
   /********* HELPER METHODS ************/


Mime
View raw message