You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by wa...@apache.org on 2018/03/23 17:31:12 UTC

asterixdb git commit: [ASTERIXDB-2338][RT] Allow concurrent accesses to an inverted list

Repository: asterixdb
Updated Branches:
  refs/heads/master ce6755422 -> f5257fef5


[ASTERIXDB-2338][RT] Allow concurrent accesses to an inverted list

- user model changes: no
- storage format changes: no
- interface changes: no

Details: Fix a bug that when a page of an inverted list
that is pinned to the buffer cache is accessed concurrently.

Change-Id: I0d6e7e7188efe1f08016af0ab1840bc0cb59d49c
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2517
Reviewed-by: Luo Chen <cl...@uci.edu>
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <ba...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/f5257fef
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/f5257fef
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/f5257fef

Branch: refs/heads/master
Commit: f5257fef5b1468d8e05b2102d59fb4f45903e022
Parents: ce67554
Author: Taewoo Kim <wa...@yahoo.com>
Authored: Thu Mar 22 19:38:00 2018 -0700
Committer: Taewoo Kim <wa...@gmail.com>
Committed: Fri Mar 23 10:30:48 2018 -0700

----------------------------------------------------------------------
 .../ondisk/FixedSizeElementInvertedListCursor.java           | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f5257fef/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/FixedSizeElementInvertedListCursor.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/FixedSizeElementInvertedListCursor.java b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/FixedSizeElementInvertedListCursor.java
index da3f079..7f3d12f 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/FixedSizeElementInvertedListCursor.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/FixedSizeElementInvertedListCursor.java
@@ -220,9 +220,11 @@ public class FixedSizeElementInvertedListCursor extends InvertedListCursor {
             // Assumption: processing inverted list takes time; so, we don't want to keep them on the buffer cache.
             // Rather, we utilize the assigned working memory (buffers).
             tmpBuffer = page.getBuffer();
-            tmpBuffer.rewind();
-            buffers.get(currentBufferIdx).rewind();
-            buffers.get(currentBufferIdx).put(tmpBuffer);
+
+            // Copies the entire content of the page to the current buffer in the working memory.
+            System.arraycopy(tmpBuffer.array(), 0, buffers.get(currentBufferIdx).array(), 0,
+                    buffers.get(currentBufferIdx).capacity());
+            buffers.get(currentBufferIdx).position(buffers.get(currentBufferIdx).capacity());
 
             currentBufferIdx++;
             bufferCache.unpin(page);