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


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -1164,23 +1164,42 @@ private TransactionalRequestResult 
handleCachedTransactionRequestResult(
         return result;
     }
 
+    /**
+     * Determines if an epoch bump can be triggered manually based on the api 
versions.
+     *
+     * <ol>
+     *   <li><b>Client-Triggered Epoch Bump</b>:
+     *          If the coordinator supports epoch bumping 
(initProducerIdVersion.maxVersion() >= 3),
+     *          client-triggered epoch bumping is allowed, returns true.
+     *          <code>epochBumpTriggerRequired</code> must be set to true in 
this case.</li>
+     *
+     *   <li><b>No Epoch Bump Allowed</b>:
+     *          If the coordinator does not support epoch bumping, returns 
false.</li>
+     *
+     *   <li><b>Server-Triggered Only</b>:
+     *          When TransactionV2 is enabled, epoch bumping is handled 
automatically
+     *          by the server in EndTxn, so manual epoch bumping is not 
required, returns false.</li>
+     * </ol>
+     *
+     * @return true if a client-triggered epoch bump is allowed, otherwise 
false.
+     */
     // package-private for testing
-    boolean canBumpEpoch() {

Review Comment:
   Did we determine this method is only called by transactional producers (ie 
not idempotent ones?) I noticed we removed the !isTransactional check. If this 
is the case, can we add a comment about that?



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to