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:08:15 UTC

svn commit: r1544079 - /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Author: nkeywal
Date: Thu Nov 21 10:08:14 2013
New Revision: 1544079

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

Modified:
    hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1544079&r1=1544078&r2=1544079&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Thu Nov 21 10:08:14 2013
@@ -2024,7 +2024,7 @@ public class HRegion implements HeapSize
     WALEdit walEdit = new WALEdit(isInReplay);
     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 */
@@ -2185,6 +2185,7 @@ public class HRegion implements HeapSize
             != OperationStatusCode.NOT_RUN) {
           continue;
         }
+        doRollBackMemstore = true; // If we have a failure, we need to clean what we wrote
         addedSize += applyFamilyMapToMemstore(familyMaps[i], w);
       }
 
@@ -2244,7 +2245,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 (!isInReplay && coprocessorHost != null) {
         MiniBatchOperationInProgress<Mutation> miniBatchOp =
@@ -2286,7 +2287,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);