kirkrodrigues opened a new issue, #10848: URL: https://github.com/apache/pinot/issues/10848
When indexing values into a [`FixedByteMVMutableForwardIndex`](https://github.com/apache/pinot/blob/master/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/forward/FixedByteMVMutableForwardIndex.java), there's no hard validation (only an [assert](https://github.com/apache/pinot/blob/master/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/forward/FixedByteMVMutableForwardIndex.java#L201) based on `_maxNumberOfMultiValuesPerRow`) that the number of values fits within a buffer. The buffer's size is based on `realtime.segment.flush.threshold.rows`, so when `realtime.segment.flush.threshold.rows` is set to a lowish value (e..g, 5K) and a large number of values is indexed, this can lead to an `IndexOutOfBoundsException` (see below). Because this exception happens while indexing a row, it can cause some values of a row to be indexed while others aren't (the same kind of corruption that I think this [comment](https://github.com/a pache/pinot/blob/master/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java#L639) refers to). ``` 2023/06/05 17:17:49.295 ERROR [MutableSegmentImpl_10840__0__0__20230605T2117Z_bug] [10840__0__0__20230605T2117Z] failed to index value with forward_index java.lang.IndexOutOfBoundsException: null at java.nio.Buffer.checkIndex(Buffer.java:693) ~[?:?] at java.nio.DirectByteBuffer.putInt(DirectByteBuffer.java:791) ~[?:?] at org.apache.pinot.segment.spi.memory.PinotByteBuffer.putInt(PinotByteBuffer.java:148) ~[pinot-all-0.13.0-SNAPSHOT-jar-with-dependencies.jar:0.13.0-SNAPSHOT-dc35068da1c253222de76027d8ca2c9458814dfd] at org.apache.pinot.segment.local.io.writer.impl.FixedByteSingleValueMultiColWriter.setInt(FixedByteSingleValueMultiColWriter.java:85) ~[pinot-all-0.13.0-SNAPSHOT-jar-with-dependencies.jar:0.13.0-SNAPSHOT-dc35068da1c253222de76027d8ca2c9458814dfd] at org.apache.pinot.segment.local.realtime.impl.forward.FixedByteMVMutableForwardIndex.setDictIdMV(FixedByteMVMutableForwardIndex.java:379) ~[pinot-all-0.13.0-SNAPSHOT-jar-with-dependencies.jar:0.13.0-SNAPSHOT-dc35068da1c253222de76027d8ca2c9458814dfd] at org.apache.pinot.segment.spi.index.mutable.MutableForwardIndex.add(MutableForwardIndex.java:77) ~[pinot-all-0.13.0-SNAPSHOT-jar-with-dependencies.jar:0.13.0-SNAPSHOT-dc35068da1c253222de76027d8ca2c9458814dfd] at org.apache.pinot.segment.local.indexsegment.mutable.MutableSegmentImpl.addNewRow(MutableSegmentImpl.java:705) [pinot-all-0.13.0-SNAPSHOT-jar-with-dependencies.jar:0.13.0-SNAPSHOT-dc35068da1c253222de76027d8ca2c9458814dfd] at org.apache.pinot.segment.local.indexsegment.mutable.MutableSegmentImpl.index(MutableSegmentImpl.java:494) [pinot-all-0.13.0-SNAPSHOT-jar-with-dependencies.jar:0.13.0-SNAPSHOT-dc35068da1c253222de76027d8ca2c9458814dfd] at org.apache.pinot.core.data.manager.realtime.LLRealtimeSegmentDataManager.processStreamEvents(LLRealtimeSegmentDataManager.java:603) [pinot-all-0.13.0-SNAPSHOT-jar-with-dependencies.jar:0.13.0-SNAPSHOT-dc35068da1c253222de76027d8ca2c9458814dfd] at org.apache.pinot.core.data.manager.realtime.LLRealtimeSegmentDataManager.consumeLoop(LLRealtimeSegmentDataManager.java:449) [pinot-all-0.13.0-SNAPSHOT-jar-with-dependencies.jar:0.13.0-SNAPSHOT-dc35068da1c253222de76027d8ca2c9458814dfd] at org.apache.pinot.core.data.manager.realtime.LLRealtimeSegmentDataManager$PartitionConsumer.run(LLRealtimeSegmentDataManager.java:667) [pinot-all-0.13.0-SNAPSHOT-jar-with-dependencies.jar:0.13.0-SNAPSHOT-dc35068da1c253222de76027d8ca2c9458814dfd] at java.lang.Thread.run(Thread.java:829) [?:?] ``` Commit: dc35068da1c253222de76027d8ca2c9458814dfd -- 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: commits-unsubscr...@pinot.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org