stanislavkozlovski commented on a change in pull request #7498:
URL: https://github.com/apache/kafka/pull/7498#discussion_r521996452



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
##########
@@ -639,8 +644,9 @@ else if (error == Errors.CLUSTER_AUTHORIZATION_FAILED)
                             "topic-partition may not exist or the user may not 
have Describe access to it",
                         batch.topicPartition);
                 } else {
-                    log.warn("Received invalid metadata error in produce 
request on partition {} due to {}. Going " +
-                            "to request metadata update now", 
batch.topicPartition, error.exception(response.errorMessage).toString());
+                    log.warn("Received invalid metadata error in produce 
request on partition {} due to {}{}. Going " +
+                            "to request metadata update now", 
batch.topicPartition,
+                            error.exception(response.errorMessage).toString(), 
errorMessageSuffix);

Review comment:
       Good catch. This normally prints:
   ```
   [2020-11-12 11:19:40,523] WARN Received invalid metadata error in produce 
request on partition test-0 due to 
org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests 
intended only for the leader, this error indicates that the broker is not the 
current leader. For requests intended for any replica, this error indicates 
that the broker is not a replica of the topic partition.. Going to request 
metadata update now (org.apache.kafka.clients.producer.internals.Sender:649)
   ```
   I've reverted the changes to this line




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