guozhangwang commented on a change in pull request #9569:
URL: https://github.com/apache/kafka/pull/9569#discussion_r523277419



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
##########
@@ -713,6 +715,8 @@ public void sendOffsetsToTransaction(Map<TopicPartition, 
OffsetAndMetadata> offs
      *         does not support transactions (i.e. if its version is lower 
than 0.11.0.0)
      * @throws org.apache.kafka.common.errors.AuthorizationException fatal 
error indicating that the configured
      *         transactional.id is not authorized. See the exception for more 
details
+     * @throws org.apache.kafka.common.errors.InvalidProducerEpochException if 
the producer has attempted to produce with an old epoch

Review comment:
       Well, as the javadoc said in producer
   
   ```
   KafkaException if the producer has encountered a previous fatal or abortable 
error, or for any
        *         other unexpected error
   ```
   
   It is not always a fatal, so the caller code , like Streams, should check 
for its root upon getting the KafkaException and then handle correspondingly: 
if its root is InvalidProducerEpoch, it should abort and begin new txn right?




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

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


Reply via email to