You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/08/19 09:17:02 UTC

[GitHub] [kafka] fabien-chebel opened a new pull request, #12541: MINOR: reduce Metadata log volume when last seen epoch is not updated

fabien-chebel opened a new pull request, #12541:
URL: https://github.com/apache/kafka/pull/12541

   Context
   -------
   
   Since updating to kafka client 3.0.1, we noticed quite a lot of new info-level logs generated by `org.apache.kafka.clients.Metadata`.
   
   The logs look like this:
   ```
   [Producer clientId=producer-1] Resetting the last seen epoch of partition user-3 to 2044 since the associated topicId changed from null to O5w7zNcCTpKdylvkOUMesQ
   ```
   
   They appear at seemingly random times, while keeping the same last seen epoch value.
   
   Proposed fix
   ------------
   
   As suggested in https://github.com/apache/kafka/pull/12378, I am updating the code condition to avoid generating a log when the last seen epoch reset operation is a no-op.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] jolshan commented on pull request #12541: MINOR: reduce Metadata log volume when last seen epoch is not updated

Posted by GitBox <gi...@apache.org>.
jolshan commented on PR #12541:
URL: https://github.com/apache/kafka/pull/12541#issuecomment-1221121457

   Thanks @fabien-chebel -- this was a solution I was thinking of when reviewing https://github.com/apache/kafka/pull/12378/files 


-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] jolshan commented on a diff in pull request #12541: MINOR: reduce Metadata log volume when last seen epoch is not updated

Posted by GitBox <gi...@apache.org>.
jolshan commented on code in PR #12541:
URL: https://github.com/apache/kafka/pull/12541#discussion_r1028468986


##########
clients/src/main/java/org/apache/kafka/clients/Metadata.java:
##########
@@ -399,9 +399,11 @@ 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);
-                lastSeenLeaderEpochs.put(tp, newEpoch);
+                if (!Objects.equals(currentEpoch, newEpoch)) {

Review Comment:
   I'm wondering though if using a primitive and an Integer is ok here. Maybe we can just compare the value of currentEpoch?



-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] fabien-chebel commented on pull request #12541: MINOR: reduce Metadata log volume when last seen epoch is not updated

Posted by GitBox <gi...@apache.org>.
fabien-chebel commented on PR #12541:
URL: https://github.com/apache/kafka/pull/12541#issuecomment-1220450125

   The original logging verbosity change was performed in https://github.com/apache/kafka/pull/11552.
   
   Pinging @jolshan, who previously reviewed https://github.com/apache/kafka/pull/12378.


-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] jolshan commented on pull request #12541: MINOR: reduce Metadata log volume when last seen epoch is not updated

Posted by GitBox <gi...@apache.org>.
jolshan commented on PR #12541:
URL: https://github.com/apache/kafka/pull/12541#issuecomment-1221122349

   Another option I was thinking of was removing the log line from the case where the previous topic ID was null. 


-- 
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-unsubscribe@kafka.apache.org

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