mjsax commented on code in PR #13431: URL: https://github.com/apache/kafka/pull/13431#discussion_r1151301814
########## streams/src/main/java/org/apache/kafka/streams/state/internals/LogicalKeyValueSegment.java: ########## @@ -176,7 +184,7 @@ public synchronized KeyValueIterator<Bytes, byte[]> range(final Bytes from, fina // with empty bytes from the returned iterator. this filtering is accomplished by // passing the prefix filter into StrippedPrefixKeyValueIteratorAdapter(). final Bytes toBound = to == null - ? Bytes.increment(prefixKeyFormatter.getPrefix()) + ? incrementWithoutOverflow(prefixKeyFormatter.getPrefix()) Review Comment: > a range query with `toBound == null` means You mean `to` here, which is the input parameter (not `toBound` which is the physical bound for the store)? > Except in the edge case where incrementing the prefix would cause overflow, in which case using null for the upper bound is correct. But if we overflow, and set `toBound = null` (as returned by `incrementWithoutOverflow()`) would it not imply we scan the physical store to its end, beyond the current logical segment bound? -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org