apoorvmittal10 commented on code in PR #20823:
URL: https://github.com/apache/kafka/pull/20823#discussion_r2491288890
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -2375,7 +2375,9 @@ be removed once all the records (0-99) are acknowledged
(ACCEPT or REJECT).
NavigableMap.Entry<Long, InFlightBatch> entry =
cachedState.floorEntry(lastOffsetAcknowledged);
// If the lastOffsetAcknowledged is equal to the last offset of
entry, then the entire batch can potentially be removed.
if (lastOffsetAcknowledged == entry.getValue().lastOffset()) {
- startOffset = cachedState.higherKey(lastOffsetAcknowledged);
+ if (cachedState.higherKey(lastOffsetAcknowledged) >
startOffset) {
Review Comment:
higherKey triggers findNear operation which is not O(1) operation, do you
want to do it twice?
--
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]