-
Notifications
You must be signed in to change notification settings - Fork 144
Improve error reporting for Kafka topic validation failures #4641
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
base: main
Are you sure you want to change the base?
Improve error reporting for Kafka topic validation failures #4641
Conversation
The upgrade tests were failing with generic "invalid topic" errors that didn't indicate which validation check failed, making diagnosis impossible. Problem: KafkaSink controller's topic validation checked multiple conditions but returned the same error for all failures: - Topic not found in DescribeTopics response - Topic has zero partitions - Topic name mismatch - Topic marked as internal Solution: Enhanced InvalidOrNotPresentTopic error to include specific failure reason: - Show which topics Kafka returned when topic not found - Report exact validation failure (no partitions, name mismatch, etc.) - Added debug logging in reconciler for validation attempts Example improved errors: - "invalid topic foo: topic not found in metadata response, got topics: [bar, baz]" - "invalid topic foo: validation failed: no partitions" - "invalid topic foo: validation failed: name mismatch (expected: foo, got: foo-bar)" Impact: Operators can now distinguish configuration errors from timing issues like metadata propagation delays. Future test failures will provide actionable diagnostics instead of generic error messages.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: creydr The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4641 +/- ##
============================================
+ Coverage 28.81% 36.17% +7.36%
- Complexity 0 901 +901
============================================
Files 294 403 +109
Lines 16149 20002 +3853
Branches 0 342 +342
============================================
+ Hits 4653 7236 +2583
- Misses 11044 12127 +1083
- Partials 452 639 +187
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The StatusTopicNotPresentOrInvalid helper function now accepts the list of available topics returned by Kafka, allowing tests to verify the new detailed error messages that show exactly which topics were found when the requested topic is missing. Changes: - Updated StatusTopicNotPresentOrInvalid signature to accept availableTopics - Updated StatusExternalBrokerTopicNotPresentOrInvalid wrapper - Updated test expectation in external_topic_not_present_or_invalid test - Error message now shows: "topic not found in metadata response, got topics: [test-topic]" This makes the test expectations flexible and avoids hardcoding topic names in the common helper function.
|
/retest-required |
The upgrade tests were failing with generic "invalid topic" errors that didn't indicate which validation check failed, making diagnosis impossible.
This PR addresses it and enhances the InvalidOrNotPresentTopic error to include specific failure reason.