chrisjakins commented on code in PR #23844:
URL: https://github.com/apache/kafka/pull/23844#discussion_r4426870808


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/ProducerBatch.java:
##########
@@ -419,7 +420,7 @@ private void 
assignProducerStateToBatches(Deque<ProducerBatch> batches) {
             ProducerIdAndEpoch producerIdAndEpoch = new 
ProducerIdAndEpoch(producerId(), producerEpoch());
             for (ProducerBatch newBatch : batches) {
                 newBatch.setProducerState(producerIdAndEpoch, sequence, 
isTransactional());
-                sequence += newBatch.recordCount;
+                               sequence = 
DefaultRecordBatch.incrementSequence(sequence, newBatch.recordCount);

Review Comment:
   Thanks for the notes, both seem like good approaches. I'm happy to implement 
either direction, do you have any preference?
   
   Introducing a long creates additional churn, but seems like the more correct 
approach to me. A custom comparator would need special casing around `-1` 
sentinel.



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