[ 
https://issues.apache.org/jira/browse/HBASE-10001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13827974#comment-13827974
 ] 

Nicolas Liochon commented on HBASE-10001:
-----------------------------------------

I was thinking about something like this:
{noformat}
@@ -2024,7 +2024,7 @@ public class HRegion implements HeapSize { // , Writable{
     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 { // , Writable{
             != 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 { // , Writable{
       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 { // , Writable{
     } 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);
{noformat}

What do you think?
In any case, since we agree that it should be on HRegion, let me create another 
jira (as I need to commit the coprocessor for 0.94 here :-) )

> Add a coprocessor to help testing the performances without taking into 
> account the i/o
> --------------------------------------------------------------------------------------
>
>                 Key: HBASE-10001
>                 URL: https://issues.apache.org/jira/browse/HBASE-10001
>             Project: HBase
>          Issue Type: Improvement
>          Components: test
>    Affects Versions: 0.98.0, 0.96.0, 0.94.13
>            Reporter: Nicolas Liochon
>            Assignee: Nicolas Liochon
>            Priority: Minor
>             Fix For: 0.98.0, 0.96.1, 0.94.15
>
>         Attachments: 10001.v1.patch, 10001.v2.patch
>
>
> We have a mockup to test only the client. If we want to include the network, 
> without beeing limited by the i/o, we don't have much tools.
> This coprocessor helps to test this.
> I put it in the main code as to make it usable without adding a jar...
> I don't think it's possible avoid the WAL writes in the coprocessors. It 
> would be great to have it to simplify the test with any kind of client (i.e. 
> w/o changing the durability).



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to