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-12931 The existing KeyValues in memstore are not removed completely after inserting cell into memStore (ChiaPing Tsai)
Date Sat, 07 Mar 2015 16:26:48 GMT
Repository: hbase
Updated Branches:
  refs/heads/master b6da97890 -> 76cbf7da6


HBASE-12931 The existing KeyValues in memstore are not removed completely after inserting
cell into memStore (ChiaPing Tsai)


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

Branch: refs/heads/master
Commit: 76cbf7da650d5858cc4a29a9efc5c64610c09f8b
Parents: b6da978
Author: tedyu <yuzhihong@gmail.com>
Authored: Sat Mar 7 08:26:43 2015 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Sat Mar 7 08:26:43 2015 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/DefaultMemStore.java  | 2 +-
 .../apache/hadoop/hbase/regionserver/TestDefaultMemStore.java  | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/76cbf7da/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
index d8ed1b3..3da0c0b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
@@ -588,7 +588,7 @@ public class DefaultMemStore implements MemStore {
         // only remove Puts that concurrent scanners cannot possibly see
         if (cur.getTypeByte() == KeyValue.Type.Put.getCode() &&
             cur.getSequenceId() <= readpoint) {
-          if (versionsVisible > 1) {
+          if (versionsVisible >= 1) {
             // if we get here we have seen at least one version visible to the oldest scanner,
             // which means we can prove that no scanner will see this version
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/76cbf7da/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
index ded8dd1..200790b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
@@ -843,12 +843,16 @@ public class TestDefaultMemStore extends TestCase {
     this.memstore.upsert(l, 2);// readpoint is 2
     long newSize = this.memstore.size.get();
     assert(newSize > oldSize);
-
+    //The kv1 should be removed.
+    assert(memstore.cellSet.size() == 2);
+    
     KeyValue kv4 = KeyValueTestUtil.create("r", "f", "q", 104, "v");
     kv4.setSequenceId(1);
     l.clear(); l.add(kv4);
     this.memstore.upsert(l, 3);
     assertEquals(newSize, this.memstore.size.get());
+    //The kv2 should be removed.
+    assert(memstore.cellSet.size() == 2);
     //this.memstore = null;
   }
 


Mime
View raw message