MINOR: reduce Metadata log volume when last seen epoch is not updated#12541
MINOR: reduce Metadata log volume when last seen epoch is not updated#12541fabien-chebel wants to merge 1 commit intoapache:trunkfrom
Conversation
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 apache#12378, I am updating the code condition to avoid generating a log when the last seen epoch reset operation is a no-op.
|
Thanks @fabien-chebel -- this was a solution I was thinking of when reviewing https://github.com/apache/kafka/pull/12378/files |
|
Another option I was thinking of was removing the log line from the case where the previous topic ID was null. |
| 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)) { |
There was a problem hiding this 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 PR is being marked as stale since it has not had any activity in 90 days. If you If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact). If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed. |
|
This PR has been closed since it has not had any activity in 120 days. If you feel like this |
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:
They appear at seemingly random times, while keeping the same last seen epoch value.
Proposed fix
As suggested in #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)