lukestephenson-zendesk commented on code in PR #13447:
URL: https://github.com/apache/kafka/pull/13447#discussion_r1236164778


##########
clients/src/main/java/org/apache/kafka/clients/Metadata.java:
##########
@@ -399,8 +399,13 @@ private Optional<MetadataResponse.PartitionMetadata> 
updateLatestMetadata(
                 // Between the time that a topic is deleted and re-created, 
the client may lose track of the
                 // corresponding topicId (i.e. `oldTopicId` will be null). In 
this case, when we discover the new
                 // topicId, we allow the corresponding leader epoch to 
override the last seen value.
-                log.info("Resetting the last seen epoch of partition {} to {} 
since the associated topicId changed from {} to {}",
-                         tp, newEpoch, oldTopicId, topicId);
+                if (oldTopicId != null) {
+                    log.info("Resetting the last seen epoch of partition {} to 
{} since the associated topicId changed from {} to {}",
+                            tp, newEpoch, oldTopicId, topicId);
+                } else {
+                    log.debug("Resetting the last seen epoch of partition {} 
to {} since the associated topicId was undefined but is now set to {}",

Review Comment:
   Thanks for the response @jolshan. I'm seeing this log statement on multiple 
Kafka producers. It is logged once every 5 minutes, for each topic partition, 
not just on startup. (Came to my attention because we exhausted our log quota 
and this was the biggest cause of logs).
   
   Here is an example log that is generated:
   ```
   [Producer clientId=producer-1] Resetting the last seen epoch of partition 
my.topic-3 to 1286 since the associated topicId changed from null to 
lkaiBwHxQ6iQHE49_AVysQ
   ```
   
   This is generated every 5 minutes for each topic partition (so a topic with 
10 partitions generates 10 log entries). Each time the topic id is updated from 
`null` to `lkaiBwHxQ6iQHE49_AVysQ`. All partitions for the same topic show the 
same topic id.
   
   Running kafka-client 3.4.0 or 3.5.0 on the producers.  Brokers are running 
Kafka 2.8.1.



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