junrao commented on code in PR #23844:
URL: https://github.com/apache/kafka/pull/23844#discussion_r4418863632
##########
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:
Instead of introducing a long? We can also have a customized comparator that
takes wrapping to 0 into consideration.
--
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]