You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by en...@apache.org on 2014/12/03 05:16:59 UTC

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

Repository: hbase
Updated Branches:
  refs/heads/0.98 4c93982fb -> 1c856e077


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/1c856e07
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1c856e07
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1c856e07

Branch: refs/heads/0.98
Commit: 1c856e0774afd8e09ef68436cf57fc0aa61e974e
Parents: 4c93982
Author: Enis Soztutar <en...@apache.org>
Authored: Tue Dec 2 20:16:45 2014 -0800
Committer: Enis Soztutar <en...@apache.org>
Committed: Tue Dec 2 20:16:45 2014 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hbase/regionserver/HRegion.java  | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/1c856e07/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 b8efc73..cebef32 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
@@ -3356,6 +3356,11 @@ public class HRegion implements HeapSize { // , Writable{
             }
           }
 
+          if (firstSeqIdInLog == -1) {
+            firstSeqIdInLog = key.getLogSeqNum();
+          }
+          currentEditSeqId = key.getLogSeqNum();
+
           // Start coprocessor replay here. The coprocessor is for each WALEdit
           // instead of a KeyValue.
           if (coprocessorHost != null) {
@@ -3366,10 +3371,6 @@ public class HRegion implements HeapSize { // , Writable{
             }
           }
 
-          if (firstSeqIdInLog == -1) {
-            firstSeqIdInLog = key.getLogSeqNum();
-          }
-          currentEditSeqId = key.getLogSeqNum();
           boolean flush = false;
           for (KeyValue kv: val.getKeyValues()) {
             // Check this edit is for me. Also, guard against writing the special
@@ -3407,10 +3408,14 @@ public class HRegion implements HeapSize { // , Writable{
             // 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, kv);
+            if (!flush) {
+              flush = restoreEdit(store, kv);
+            }
             editsCount++;
           }
-          if (flush) internalFlushcache(null, currentEditSeqId, status);
+          if (flush) {
+            internalFlushcache(null, currentEditSeqId, status);
+          }
 
           if (coprocessorHost != null) {
             coprocessorHost.postWALRestore(this.getRegionInfo(), key, val);