J-HowHuang opened a new pull request, #18834:
URL: https://github.com/apache/pinot/pull/18834
## Desciption
H3 index could run into exception
```
2026/06/19 23:02:10.190 ERROR [TaskFactoryRegistry]
[TaskStateModelFactory-task_thread-2] Caught
exception while executing task:
Task_SegmentRefreshTask_6e158344-12a2-401e-bc11-5464d0df28af_1781910006722_11
java.lang.IndexOutOfBoundsException
at java.base/java.nio.Buffer$1.apply(Buffer.java:757)
at java.base/java.nio.Buffer$1.apply(Buffer.java:754)
at
java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
at
java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
at
java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
at
java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
at
java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
at java.base/java.nio.Buffer.checkIndex(Buffer.java:779)
at
java.base/java.nio.DirectByteBuffer.getLong(DirectByteBuffer.java:861)
at
org.apache.pinot.segment.spi.memory.PinotByteBuffer.getLong(PinotByteBuffer.java:181)
at
org.apache.pinot.segment.local.segment.creator.impl.inv.geospatial.OffHeapH3IndexCreator$ChunkIt
erator.next(OffHeapH3IndexCreator.java:193)
at
org.apache.pinot.segment.local.segment.creator.impl.inv.geospatial.OffHeapH3IndexCreator.seal(Of
fHeapH3IndexCreator.java:138)
at
org.apache.pinot.segment.local.segment.creator.impl.ColumnIndexCreators.seal(ColumnIndexCreators
.java:98)
```
because empty chunk could be added into the chunk list. An empty chunk would
cause out of bound read in `ChunkIterator`
## Change
* Don't add when posting list is empty while flush
* Check and skip empty chunk while iterating
## Test
Added an unit test and verified it would fail without the patch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]