Fix: Handle partial consumer group lag calculation failures#2574
Open
ngyngcphu wants to merge 1 commit into
Open
Fix: Handle partial consumer group lag calculation failures#2574ngyngcphu wants to merge 1 commit into
ngyngcphu wants to merge 1 commit into
Conversation
Consumer group lag calculation used to fail the whole overview when ListEndOffsets returned a partial ListOffsets failure. Continue on partial failures so healthy partitions can still report lag, while affected partitions use the existing partition error field. Keep total failures fatal.
There was a problem hiding this comment.
Pull request overview
This PR updates consumer group lag calculation to tolerate partial ListEndOffsets/ListOffsets failures (e.g., LISTENER_NOT_FOUND, LEADER_NOT_AVAILABLE) so the consumer group overview can still be returned for healthy partitions, aligning behavior with issues #2573 and #2327.
Changes:
- Treat
kadm.ShardErrorsfromListEndOffsetsas non-fatal when some shards succeed, logging a warning and continuing with partial data. - Populate per-partition error details when end offsets cannot be fetched, instead of failing the whole request.
- Add a regression test covering partial
ListEndOffsetsfailures for common broker/partition error scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| backend/pkg/console/consumer_group_offsets.go | Allows consumer group lag calculations to proceed when end-offset fetches partially fail, surfacing failures per partition. |
| backend/pkg/console/consumer_group_offsets_test.go | Adds coverage for partial end-offset failures to ensure graceful degradation for consumer group lag results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
208
to
+212
| ass.Equal(expected, result, "Result should match expected (deleted topic skipped)") | ||
| } | ||
|
|
||
| func TestGetConsumerGroupOffsets_PartialListEndOffsetsFailure(t *testing.T) { | ||
| testCases := []struct { |
ngyngcphu
force-pushed
the
fix/consumer-group-partial-offset-errors
branch
from
July 23, 2026 08:46
e735cd7 to
0c70ea6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed #2573
Related to #2327
Before fix, run test
TestGetConsumerGroupOffsets_PartialListEndOffsetsFailure, got error:After fix, run test
TestGetConsumerGroupOffsets_PartialListEndOffsetsFailuresuccessfully: