DL1231 commented on code in PR #20837:
URL: https://github.com/apache/kafka/pull/20837#discussion_r2508490053
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -1885,6 +1899,11 @@ private int acquireSubsetBatchRecords(
continue;
}
+ // If the record has any pending deliveries, return
immediately and do not deliver the current bad record.
+ if (offsetState.getValue().deliveryCount() >=
BAD_RECORD_DELIVERY_THRESHOLD && (hasBeenAcquired > 0 || acquiredCount > 0)) {
+ return -acquiredCount;
+ }
+
Review Comment:
If the `deliveryCount` of the current record is greater than or equal to the
threshold, it indicates that the current record is a `bad record` and may fail
to be delivered.
- If there are already pending deliveries, we should immediately send those
to avoid being affected by the bad record.
- If there are no pending deliveries, the bad record should be sent
individually.
--
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]