>From Michael Blow <[email protected]>:

Michael Blow has submitted this change. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20723?usp=email )

Change subject: [NO ISSUE][*DB][STO] Fix IndexOutOfBoundsException when 
flushPtr is 0
......................................................................

[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
---
M 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/GlobalVirtualBufferCache.java
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins: Verified; Verified
  Michael Blow: Looks good to me, approved
  Anon. E. Moose #1000171:




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 2c925fd..aa636c8 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 @@
                     }
                     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();

--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20723?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: asterixdb
Gerrit-Branch: phoenix
Gerrit-Change-Id: I8a3761d0ab3759694af51f77bf8bfa9cbbcb8d1d
Gerrit-Change-Number: 20723
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Blow <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-CC: Peeyush Gupta <[email protected]>

Reply via email to