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

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

commit 4139cd0e790d425d337ca981fb11a8ec3cf93df5
Author: Peeyush Gupta <[email protected]>
AuthorDate: Mon Dec 15 22:22:15 2025 -0800

    [NO ISSUE][*DB][STO] Fix IndexOutOfBoundsException when flushPtr is 0
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Ext-ref: MB-69772
    Change-Id: I8a3761d0ab3759694af51f77bf8bfa9cbbcb8d1d
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20652
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Michael Blow <[email protected]>
    Integration-Tests: Jenkins <[email protected]>
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20723
---
 .../org/apache/asterix/common/context/GlobalVirtualBufferCache.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
index 2c925fd028..aa636c8684 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
@@ -149,7 +149,7 @@ public class GlobalVirtualBufferCache implements 
IVirtualBufferCache, ILifeCycle
                     }
                     if (primaryIndexes.isEmpty()) {
                         flushPtr = 0;
-                    } else if (flushPtr >= pos) {
+                    } else if (flushPtr >= pos && flushPtr > 0) {
                         // If the removed index is before flushPtr, we should 
decrement flushPtr by 1 so that
                         // it still points to the same index.
                         flushPtr = (flushPtr - 1) % primaryIndexes.size();

Reply via email to