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-11099 Two situations where we could open a region with smaller sequence number (Stephen Jiang)
Date Thu, 20 Nov 2014 22:43:28 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 7eefd0cbe -> d2ff1269f


HBASE-11099 Two situations where we could open a region with smaller sequence number (Stephen
Jiang)


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

Branch: refs/heads/master
Commit: d2ff1269f99083bebb4e27698e7df59c13698e50
Parents: 7eefd0c
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Nov 20 14:43:16 2014 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Nov 20 14:43:16 2014 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/HRegion.java      | 23 +++++++++++++-------
 1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d2ff1269/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index c545950..7685815 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -3521,6 +3521,13 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver
{ //
             }
           }
 
+          if (firstSeqIdInLog == -1) {
+            firstSeqIdInLog = key.getLogSeqNum();
+          }
+          currentEditSeqId = key.getLogSeqNum();
+          currentReplaySeqId = (key.getOrigLogSeqNum() > 0) ?
+            key.getOrigLogSeqNum() : currentEditSeqId;
+
           // Start coprocessor replay here. The coprocessor is for each WALEdit
           // instead of a KeyValue.
           if (coprocessorHost != null) {
@@ -3531,12 +3538,6 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver
{ //
             }
           }
 
-          if (firstSeqIdInLog == -1) {
-            firstSeqIdInLog = key.getLogSeqNum();
-          }
-          currentEditSeqId = key.getLogSeqNum();
-          currentReplaySeqId = (key.getOrigLogSeqNum() > 0) ?
-            key.getOrigLogSeqNum() : currentEditSeqId;
           boolean flush = false;
           for (Cell cell: val.getCells()) {
             // Check this edit is for me. Also, guard against writing the special
@@ -3572,13 +3573,19 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver
{ //
               continue;
             }
             CellUtil.setSequenceId(cell, currentReplaySeqId);
+
             // Once we are over the limit, restoreEdit will keep returning true to
             // flush -- but don't flush until we've played all the kvs that make up
             // the WALEdit.
-            flush = restoreEdit(store, cell);
+            if (!flush) {
+              flush = restoreEdit(store, cell);
+            }
+
             editsCount++;
           }
-          if (flush) internalFlushcache(null, currentEditSeqId, status);
+          if (flush) {
+            internalFlushcache(null, currentEditSeqId, status);
+          }
 
           if (coprocessorHost != null) {
             coprocessorHost.postWALRestore(this.getRegionInfo(), key, val);


Mime
View raw message