-
Notifications
You must be signed in to change notification settings - Fork 14.9k
KAFKA-19596: Improve visibility when topic auto-creation fails #20340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
For example, if I:
Now I will see logs in the server like: |
showuon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the AutoTopicCreateManager just wants to try to create the topics once without retry, which is fine to me because users can create the topic manually later. Left a comment. Thanks.
| warn(s"Auto topic creation failed for ${topicResult.name()} with error '${error.name()}': ${topicResult.errorMessage()}") | ||
| } | ||
| }) | ||
| case _ => // do nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you think this should be also an error we should log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, have added a warn log in this case
8cff9ef to
f22ae59
Compare
showuon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the improvement.
brandboat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the enhancement!
| createTopicsResponse.data().topics().forEach(topicResult => { | ||
| val error = Errors.forCode(topicResult.errorCode()) | ||
| if (error != Errors.NONE) { | ||
| warn(s"Auto topic creation failed for ${topicResult.name()} with error '${error.name()}': ${topicResult.errorMessage()}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nit: we can skip () for getters
| warn(s"Auto topic creation failed for ${topicResult.name()} with error '${error.name()}': ${topicResult.errorMessage()}") | |
| warn(s"Auto topic creation failed for ${topicResult.name} with error '${error.name}': ${topicResult.errorMessage}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, have killed off ()
Log a warning for each topic that failed to be created as a result of an automatic creation. Previously, at the default log level, you could only see logs that the broker was attempting to autocreate topics. If the creation failed it was logged at debug. This makes it more visible. Signed-off-by: Robert Young <robertyoungnz@gmail.com>
f22ae59 to
5924673
Compare
| createTopicsResponse.data().topics().forEach(topicResult => { | ||
| val error = Errors.forCode(topicResult.errorCode) | ||
| if (error != Errors.NONE) { | ||
| warn(s"Auto topic creation failed for ${topicResult.name} with error '${error.name}': ${topicResult.errorMessage}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered logging the request to provide a more useful debug message?
Log a warning for each topic that failed to be created as a result of an automatic creation. This makes the underlying cause more visible so users can take action.
Previously, at the default log level, you could only see logs that the broker was attempting to autocreate topics. If the creation failed, then it was logged at debug.