Bug fix.

git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_lsm_tree@1098 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-storage-am-lsm-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/rtree/impls/LSMRTree.java b/hyracks-storage-am-lsm-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/rtree/impls/LSMRTree.java
index 67c4d53..3022038 100644
--- a/hyracks-storage-am-lsm-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/rtree/impls/LSMRTree.java
+++ b/hyracks-storage-am-lsm-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/rtree/impls/LSMRTree.java
@@ -222,7 +222,8 @@
             // Wait for ongoing flush to complete.
             synchronized (this) {
                 if (!flushFlag) {
-                    // Increments threadRefCount, to force a flush to wait for this operation to finish.
+                    // Increments threadRefCount, to force a flush to wait for
+                    // this operation to finish.
                     // (a flush can only begin once threadRefCount == 0).
                     threadEnter();
                     // Proceed with operation.
@@ -394,7 +395,6 @@
         if (!isMerging.compareAndSet(false, true)) {
             throw new TreeIndexException("Merge already in progress in LSMRTree. Only one concurrent merge allowed.");
         }
-        isMerging.set(true);
 
         // Point to the current searcher ref count, so we can wait for it later
         // (after we swap the searcher ref count).