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


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -99,6 +99,14 @@
 public class TransactionManager {
     private static final int NO_INFLIGHT_REQUEST_CORRELATION_ID = -1;
 
+    /**
+     * The number of batches per producer id whose metadata the broker retains 
for duplicate detection, matching
+     * {@code ProducerStateEntry.NUM_BATCHES_TO_RETAIN}. 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}.
+     */
+    static final int NUM_BATCHES_RETAINED_BY_BROKER = 5;

Review Comment:
   Could we have a single source of truth for this magic number? It is a bit 
strange to me that different modules hold their own copy of it.



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