You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nk...@apache.org on 2013/11/21 11:27:55 UTC

svn commit: r1544090 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Author: nkeywal
Date: Thu Nov 21 10:27:54 2013
New Revision: 1544090

URL: http://svn.apache.org/r1544090
Log:
HBASE-10014 HRegion#doMiniBatchMutation rollbacks the memstore even if there is nothing to rollback.

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1544090&r1=1544089&r2=1544090&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Thu Nov 21 10:27:54 2013
@@ -2240,7 +2240,7 @@ public class HRegion implements HeapSize
 
     MultiVersionConsistencyControl.WriteEntry w = null;
     long txid = 0;
-    boolean walSyncSuccessful = false;
+    boolean doRollBackMemstore = false;
     boolean locked = false;
 
     /** Keep track of the locks we hold so we can release them in finally clause */
@@ -2409,6 +2409,7 @@ public class HRegion implements HeapSize
             != OperationStatusCode.NOT_RUN) {
           continue;
         }
+        doRollBackMemstore = true;
         addedSize += applyFamilyMapToMemstore(familyMaps[i], w);
       }
 
@@ -2475,7 +2476,7 @@ public class HRegion implements HeapSize
       if (walEdit.size() > 0) {
         syncOrDefer(txid, durability);
       }
-      walSyncSuccessful = true;
+      doRollBackMemstore = false;
       // calling the post CP hook for batch mutation
       if (coprocessorHost != null) {
         MiniBatchOperationInProgress<Pair<Mutation, Integer>> miniBatchOp = 
@@ -2516,7 +2517,7 @@ public class HRegion implements HeapSize
     } finally {
 
       // if the wal sync was unsuccessful, remove keys from memstore
-      if (!walSyncSuccessful) {
+      if (doRollBackMemstore) {
         rollbackMemstore(batchOp, familyMaps, firstIndex, lastIndexExclusive);
       }
       if (w != null) mvcc.completeMemstoreInsert(w);