Skip to content

KAFKA-9479: Print describe --state header once for multiple groups#22301

Open
Hana1025 wants to merge 3 commits into
apache:trunkfrom
Hana1025:KAFKA-9479-describe-all-groups-header-once
Open

KAFKA-9479: Print describe --state header once for multiple groups#22301
Hana1025 wants to merge 3 commits into
apache:trunkfrom
Hana1025:KAFKA-9479-describe-all-groups-header-once

Conversation

@Hana1025
Copy link
Copy Markdown
Contributor

@Hana1025 Hana1025 commented May 17, 2026

When describing multiple consumer groups with --state (including
--all-groups), compute column widths across all groups and print the
header once.

When describing multiple consumer groups with --state (including --all-groups),
compute column widths across all groups and print the header once.
@smjn
Copy link
Copy Markdown
Collaborator

smjn commented May 17, 2026

@Hana1025
Pease provide sample output before and after with no groups, single group and multiple groups.

aparanoid added 2 commits May 19, 2026 01:34
Extract coordinator formatting helper and add a test that verifies the
state header is printed only once when describing multiple groups.
Data rows do not contain the COORDINATOR (ID) header label. Use explicit
--group flags and count non-blank lines instead.
@Hana1025
Copy link
Copy Markdown
Contributor Author

@Hana1025 Pease provide sample output before and after with no groups, single group and multiple groups.

@smjn Thanks for the review. Sample output for kafka-consumer-groups.sh --describe --state is below (using --bootstrap-server localhost:9092).

No consumer groups (--all-groups on a cluster with no groups)
Before / After: (no table output)

printStates returns immediately when there are no printable groups.

Single group (--group group1 --state)
Before / After: (unchanged — one header and one data row)

GROUP COORDINATOR (ID) ASSIGNMENT-STRATEGY STATE #MEMBERS
group1 localhost:9092 (1) range Stable 1
Multiple groups (--all-groups with group1 and group2)
Before: header repeated for each group

GROUP COORDINATOR (ID) ASSIGNMENT-STRATEGY STATE #MEMBERS
group1 localhost:9092 (1) range Stable 1
GROUP COORDINATOR (ID) ASSIGNMENT-STRATEGY STATE #MEMBERS
group2 localhost:9092 (1) range Stable 1
After: header printed once; column widths computed across all groups

GROUP COORDINATOR (ID) ASSIGNMENT-STRATEGY STATE #MEMBERS
group1 localhost:9092 (1) range Stable 1
group2 localhost:9092 (1) range Stable 1
The same behavior applies when multiple groups are specified with repeated --group flags (e.g. --group group1 --group group2 --state).

Also pushed commit b7db1be with a regression test that asserts the state header is printed only once for multiple --group --state.

@github-actions
Copy link
Copy Markdown

ghost commented May 25, 2026

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants