asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "abdullah alamoudi (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Fix: Cursor can release entity lock twice in case of reconsile
Date Sun, 04 Jun 2017 10:41:01 GMT
abdullah alamoudi has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1804

Change subject: Fix: Cursor can release entity lock twice in case of reconsile
......................................................................

Fix: Cursor can release entity lock twice in case of reconsile

Change-Id: Ia7f831147f6df6a712e592e029a28a1e9b8ef5a5
---
M hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/04/1804/1

diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java
index 3b8b160..65323ea 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeRangeSearchCursor.java
@@ -89,6 +89,7 @@
         while (!outputPriorityQueue.isEmpty() || needPushElementIntoQueue == true) {
             if (!outputPriorityQueue.isEmpty()) {
                 PriorityQueueElement checkElement = outputPriorityQueue.peek();
+                boolean completed = false;
                 if (canCallProceed) {
                     resultOfSearchCallBackProceed = searchCallback.proceed(checkElement.getTuple());
                     if (!resultOfSearchCallBackProceed) {
@@ -128,6 +129,7 @@
                                     // after reconcile() since we can guarantee that there
is no change.
                                     searchCallback.reconcile(checkElement.getTuple());
                                     searchCallback.complete(checkElement.getTuple());
+                                    completed = true;
                                 }
                                 // Re-traverses the index.
                                 reusablePred.setLowKey(copyTuple, true);
@@ -146,6 +148,7 @@
                                     // The searched key is still there.
                                     // TODO: do we need to call or not call complete() in
this case?
                                     searchCallback.complete(copyTuple);
+                                    completed = true;
                                 }
                             } else {
                                 // The mutable cursor is exhausted and it couldn't find the
element.
@@ -163,7 +166,7 @@
                 // If there is no previous tuple or the previous tuple can be ignored.
                 // This check is needed not to release the same tuple again.
                 if (outputElement == null) {
-                    if (isDeleted(checkElement) && !returnDeletedTuples) {
+                    if (isDeleted(checkElement) && !returnDeletedTuples &&
!completed) {
                         // If the key has been deleted then pop it and set needPush to true.
                         // We cannot push immediately because the tuple may be
                         // modified if hasNext() is called

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1804
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7f831147f6df6a712e592e029a28a1e9b8ef5a5
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message