chia7712 commented on code in PR #23663:
URL: https://github.com/apache/kafka/pull/23663#discussion_r4647003442


##########
clients/src/main/java/org/apache/kafka/common/record/internal/RecordBatch.java:
##########
@@ -64,6 +64,15 @@ public interface RecordBatch extends Iterable<Record> {
      */
     int NO_PARTITION_LEADER_EPOCH = -1;
 
+    /**
+     * The number of batches per producer id and partition whose metadata the 
broker retains for duplicate
+     * detection. Once this many batches have been appended after a batch, a 
retry of that batch is no longer
+     * recognised as a duplicate and fails with {@code 
OUT_OF_ORDER_SEQUENCE_NUMBER}. The idempotent producer
+     * therefore caps {@code max.in.flight.requests.per.connection} at this 
value, and does not assign sequences
+     * to new batches while that could push its oldest in-flight batch out of 
this window.
+     */
+    int NUM_BATCHES_RETAINED_PER_PRODUCER = 5;

Review Comment:
   I think the case this PR wants to fix still lacks server side support in one 
scenario. I have opened https://issues.apache.org/jira/browse/KAFKA-21605
   
   In short, the server only keeps the last batch once it restarts. That means 
a restarted leader will still return an out of order sequence error, and this 
patch can't save our clients in that case.



-- 
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]

Reply via email to