This is an automated email from the ASF dual-hosted git repository.

wyk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 983497afc2 [ASTERIXDB-3441][STO] Fix race condition in 
CloudColumnIndexDiskCacheManager
983497afc2 is described below

commit 983497afc21f832ad638dfc6c4d7b13f7829d780
Author: Wail Alkowaileet <[email protected]>
AuthorDate: Thu Jun 20 10:13:28 2024 -0700

    [ASTERIXDB-3441][STO] Fix race condition in CloudColumnIndexDiskCacheManager
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details
    setIndexedColumns() and getIndexedColumnsCopy() could
    interfer with each other. They both must be a sync. methods.
    
    Change-Id: I52aa2f9c503a02bb177a2e163bdb0531fec9c70f
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18393
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Murtadha Hubail <[email protected]>
---
 .../storage/am/lsm/btree/column/cloud/sweep/ColumnSweepPlanner.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree-column/src/main/java/org/apache/hyracks/storage/am/lsm/btree/column/cloud/sweep/ColumnSweepPlanner.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree-column/src/main/java/org/apache/hyracks/storage/am/lsm/btree/column/cloud/sweep/ColumnSweepPlanner.java
index 9d52603ebd..d12f649569 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree-column/src/main/java/org/apache/hyracks/storage/am/lsm/btree/column/cloud/sweep/ColumnSweepPlanner.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree-column/src/main/java/org/apache/hyracks/storage/am/lsm/btree/column/cloud/sweep/ColumnSweepPlanner.java
@@ -94,9 +94,11 @@ public final class ColumnSweepPlanner {
         resizeStatsArrays(numberOfColumns);
         setInitialSizes(diskComponents, sweepProjector, bufferCache);
         active.set(true);
+        // Initialize access time to the time of activating the index
+        lastAccess = clock.getCurrentTime();
     }
 
-    public void setIndexedColumns(IColumnProjectionInfo projectionInfo) {
+    public synchronized void setIndexedColumns(IColumnProjectionInfo 
projectionInfo) {
         indexedColumns.clear();
         for (int i = 0; i < projectionInfo.getNumberOfProjectedColumns(); i++) 
{
             int columnIndex = projectionInfo.getColumnIndex(i);
@@ -104,7 +106,7 @@ public final class ColumnSweepPlanner {
         }
     }
 
-    public IntSet getIndexedColumnsCopy() {
+    public synchronized IntSet getIndexedColumnsCopy() {
         return new IntOpenHashSet(indexedColumns);
     }
 

Reply via email to