jolshan commented on code in PR #21469:
URL: https://github.com/apache/kafka/pull/21469#discussion_r2885224909


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerAppendInfo.java:
##########
@@ -127,9 +127,11 @@ private void checkProducerEpoch(short producerEpoch, long 
offset, short transact
             // In both cases, the transaction has already ended 
(currentTxnFirstOffset is empty).
             // We suppress the InvalidProducerEpochException and allow the 
duplicate marker to
             // be written to the log.
+            // In some buggy scenarios we may start transaction with 
MAX_VALUE.  We allow
+            // code to gracefully recover from that.
             if (transactionVersion >= 2 &&
                     producerEpoch == current &&
-                    updatedEntry.currentTxnFirstOffset().isEmpty()) {
+                    (updatedEntry.currentTxnFirstOffset().isEmpty() || 
producerEpoch == Short.MAX_VALUE)) {

Review Comment:
   I don't think it is a big deal, but this log doesn't quite apply for the 
scenario. Given though that we have other logs, I'm ok with leaving as is.



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