adixitconfluent commented on code in PR #20823:
URL: https://github.com/apache/kafka/pull/20823#discussion_r2491207270
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -2389,8 +2389,11 @@ be removed once all the records (0-99) are acknowledged
(ACCEPT or REJECT).
lastKeyToRemove = entry.getKey();
} else {
// The code will reach this point only if
lastOffsetAcknowledged is in the middle of some stateBatch. In this case
- // we can simply move the startOffset to the next offset of
lastOffsetAcknowledged and should consider any read gap offsets.
- startOffset = lastOffsetAcknowledged + 1;
+ // we can move the startOffset to the next offset of
lastOffsetAcknowledged only if that offset is
+ // ahead of start offset and should consider any read gap
offsets.
+ if (lastOffsetAcknowledged + 1 > startOffset) {
Review Comment:
Sounds reasonable to add that check here. I don't think there is a harm in
adding that check.
--
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]