hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject git commit: HBASE-11882 Row level consistency may not be maintained with bulk load and compaction (Jerry He) Signed-off-by: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Date Fri, 05 Sep 2014 03:28:47 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 4386d6eb1 -> 5fa07efd7


HBASE-11882 Row level consistency may not be maintained with bulk load and
compaction (Jerry He)
Signed-off-by: Ramkrishna <ramkrishna.s.vasudevan@intel.com>


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

Branch: refs/heads/branch-1
Commit: 5fa07efd700ad40a5c6a6616b16b9189faba2949
Parents: 4386d6e
Author: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Authored: Fri Sep 5 08:57:52 2014 +0530
Committer: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Committed: Fri Sep 5 08:57:52 2014 +0530

----------------------------------------------------------------------
 .../hbase/regionserver/compactions/Compactor.java     | 14 +++++++++++---
 .../hbase/regionserver/TestHRegionServerBulkLoad.java |  1 +
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5fa07efd/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
index 2b053a6..7eab275 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java
@@ -136,9 +136,17 @@ public abstract class Compactor {
       fd.maxKeyCount += keyCount;
       // calculate the latest MVCC readpoint in any of the involved store files
       Map<byte[], byte[]> fileInfo = r.loadFileInfo();
-      byte tmp[] = fileInfo.get(HFileWriterV2.MAX_MEMSTORE_TS_KEY);
-      if (tmp != null) {
-        fd.maxMVCCReadpoint = Math.max(fd.maxMVCCReadpoint, Bytes.toLong(tmp));
+      byte tmp[] = null;
+      // Get and set the real MVCCReadpoint for bulk loaded files, which is the
+      // SeqId number.
+      if (r.isBulkLoaded()) {
+        fd.maxMVCCReadpoint = Math.max(fd.maxMVCCReadpoint, r.getSequenceID());
+      }
+      else {
+        tmp = fileInfo.get(HFileWriterV2.MAX_MEMSTORE_TS_KEY);
+        if (tmp != null) {
+          fd.maxMVCCReadpoint = Math.max(fd.maxMVCCReadpoint, Bytes.toLong(tmp));
+        }
       }
       tmp = fileInfo.get(FileInfo.MAX_TAGS_LEN);
       if (tmp != null) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/5fa07efd/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
index 26570d1..efa5a22 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
@@ -115,6 +115,7 @@ public class TestHRegionServerBulkLoad {
         KeyValue kv = new KeyValue(rowkey(i), family, qualifier, now, value);
         writer.append(kv);
       }
+      writer.appendFileInfo(StoreFile.BULKLOAD_TIME_KEY, Bytes.toBytes(now));
     } finally {
       writer.close();
     }


Mime
View raw message