AndrewJSchofield commented on code in PR #20837:
URL: https://github.com/apache/kafka/pull/20837#discussion_r2650633276
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -1885,7 +1914,29 @@ private int acquireSubsetBatchRecords(
continue;
}
- InFlightState updateResult =
offsetState.getValue().tryUpdateState(RecordState.ACQUIRED,
DeliveryCountOps.INCREASE,
+ int recordDeliveryCount =
offsetState.getValue().deliveryCount();
+ // If the record is on last delivery attempt then isolate that
record to be delivered alone.
+ // If the respective record is corrupt then it prevents
increasing delivery count of multiple
+ // records in a single response batch. Condition below checks
if the current record has reached
+ // the delivery limit and already have some records to return
in response then skip processing
+ // the current record, which shall be delivered alone in next
fetch.
+ if (maxDeliveryCount > 2 && recordDeliveryCount ==
maxDeliveryCount - 1 && acquiredCount > 0) {
+ break;
Review Comment:
The flakiness of `testComplexShareConsumer` is unfortunate. We certainly
should have anticipated that. However, it is also a hideously unfriendly
application designed to stress all of the corners of the system, which it has
certainly achieved based on some of the issues it unearthed. Adding the logging
in the patch seems like a good thing. I don't think adding another
configuration is helpful in isolation.
--
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]