philipnee commented on code in PR #12149:
URL: https://github.com/apache/kafka/pull/12149#discussion_r1171757259


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java:
##########
@@ -300,9 +301,13 @@ void runOnce() {
             try {
                 transactionManager.maybeResolveSequences();
 
+                RuntimeException lastError = transactionManager.lastError();
+                if (transactionManager.hasAbortableError() && 
shouldHandleAuthorizationError(lastError)) {
+                    return;

Review Comment:
   Hey @jolshan - I actually think we don't need to manually bump the epoch 
here.  I think it is already handled by the existing logic.  Here's the 
explanation. I think initProducerId is only happening at 2 different places: 1. 
`initializeTransactions` and 2. in the sender loop for idempotent producer 
`bumpIdempotentEpochAndResetIdIfNeeded`.
   
   for 1. It will bump the epoch if the epoch != None, which means the producer 
has been initialized and needs to bump the epoch upon re-requesting the id per 
your comment
   
   for 2. it is when we first initialize a producer (so it doesn't have an id 
at the beginning), and the `InitProducerIdRequest` should bump the epoch to 0 
upon first successful attempt.  This is the case we are addressing in this PR I 
think.



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