You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mb...@apache.org on 2026/01/15 21:36:37 UTC
(asterixdb) 08/22: [NO ISSUE][*DB][STO] Fix IndexOutOfBoundsException when flushPtr is 0
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 1c5a87019bc4913177d593c70e920f118933ad10
Author: Peeyush Gupta <pe...@couchbase.com>
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 <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mb...@apache.org>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
---
.../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 7fe3c4c50c..43f04e4d0c 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
@@ -145,7 +145,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();