Skip to content

[server] Implement consumer group management APIs - #5203

Merged
wuchong merged 7 commits into
apache:mainfrom
pisceslj:feature/fip-53-server-consumer-group-management
Nov 16, 2026
Merged

wuchong merged 7 commits into
apache:mainfrom
pisceslj:feature/fip-53-server-consumer-group-management

Conversation

@pisceslj

@pisceslj pisceslj commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #5202

Part of #4608.

Implement consumer-group management APIs on tablet servers so administrators can
list groups, delete consumer-group metadata, and delete selected committed
offsets. LIST_CONSUMER_GROUPS returns groups owned by the receiving tablet
server; callers that need a cluster-wide view must query every tablet server and
merge the results.

Brief change log

  • Implement LIST_CONSUMER_GROUPS, DELETE_CONSUMER_GROUPS, and
    DELETE_CONSUMER_OFFSETS in TabletService.
  • Add group metadata row encoders and per-bucket offset deletion results in
    ConsumerGroupManager and ConsumerOffsetSchema.
  • Reject duplicate group IDs and duplicate table buckets with INVALID_REQUEST.
  • Report every requested bucket in DELETE_CONSUMER_OFFSETS responses; missing
    buckets are successful no-ops.
  • Require READ on live source tables before deleting their offsets. Deleted
    source tables no longer have a table resource and will rely on group-level ACL
    once that work merges.
  • Update authorization.md with the new protocol
    operations and their current authorization semantics.

Tests

  • ConsumerGroupErrorsTest: 3 cases.
  • ConsumerOffsetSchemaTest and GroupManagerManagementTest: 15 cases.
  • ConsumerGroupManagerTest, ConsumerGroupManagerFetchTest,
    ConsumerGroupManagerCommitFailureTest, and ConsumerGroupDiscoveryTest: 20 cases.
  • ConsumerOffsetCommitITCase, ConsumerOffsetCommitAuthorizationITCase,
    ConsumerOffsetFetchITCase, ConsumerOffsetFetchAuthorizationITCase, and ConsumerOffsetTableITCase: 11 cases.
  • ServerRpcMessageUtilsTest and TabletServiceTest: 32 cases.

API and Format

Adds consumer-group management implementations for existing RPC API keys.
Existing RPC message schemas remain unchanged. DELETE_CONSUMER_GROUPS removes
consumer-group metadata only and does not remove committed offsets.
DELETE_CONSUMER_OFFSETS removes only the requested committed offsets. No wire format changes are introduced.

Documentation

Updates authorization.md with the new protocol operations and their current authorization semantics.

@pisceslj
pisceslj force-pushed the feature/fip-53-server-consumer-group-management branch from 5a4fd72 to 5b2037d Compare November 13, 2026 12:46
Comment thread website/docs/security/authorization.md Resolved
Implement list and delete consumer groups and delete consumer offsets on the tablet server. Add group metadata key encoders, per-bucket offset deletion results, and INVALID_REQUEST validation for duplicate group IDs and table buckets. Authorize live source tables before offset deletion and update the authorization documentation.
- Add Group-level visibility to LIST_CONSUMER_GROUPS while preserving Cluster DESCRIBE inheritance.
- Make DELETE_CONSUMER_GROUPS remove both group metadata and all committed offsets.
- Require Group WRITE and source Table READ for DELETE_CONSUMER_OFFSETS, with group-only cleanup only for confirmed-deleted tables.
- Remove redundant result wrappers and the pre-read before offset deletion.
- Update RPC Javadocs, proto comments, authorization docs, and generated Rust protobuf code.
- Add real RPC integration tests for listing, deletion, authorization, and persisted offsets.
@pisceslj
pisceslj force-pushed the feature/fip-53-server-consumer-group-management branch from 5b2037d to 848ec83 Compare November 15, 2026 14:43
wuchong and others added 3 commits November 15, 2026 23:54
Co-Authored-By: Codex <noreply@openai.com>
AI-Contributed/Feature: 75/77
AI-Contributed/UT: 123/123
Co-Authored-By: Codex <noreply@openai.com>
AI-Contributed/Feature: 0/0
AI-Contributed/UT: 27/27

@wuchong wuchong left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pisceslj I’ve pushed several commits to simplify the code:

  1. Simplified DELETE_CONSUMER_OFFSETS to require only WRITE(Group), removing the source-table READ check and the deleted-table tracking in the metadata cache. I realized it's difficult or heavy to check the table is deleted. Maintaining deleted tables in metadata is not safe, since it's cleared after server restarting.
  2. Simplified code in ConsumerGroupManager and ConsumerOffsetSchema

If you are fine with the changes, I will merge it once CI is passed.

Co-Authored-By: Codex <noreply@openai.com>
AI-Contributed/Feature: 0/0
AI-Contributed/UT: 19/19
@pisceslj

Copy link
Copy Markdown
Contributor Author

@pisceslj I’ve pushed several commits to simplify the code:

  1. Simplified DELETE_CONSUMER_OFFSETS to require only WRITE(Group), removing the source-table READ check and the deleted-table tracking in the metadata cache. I realized it's difficult or heavy to check the table is deleted. Maintaining deleted tables in metadata is not safe, since it's cleared after server restarting.
  2. Simplified code in ConsumerGroupManager and ConsumerOffsetSchema

If you are fine with the changes, I will merge it once CI is passed.

LGTM. Requiring only Group WRITE avoids the fragile deleted-table tracking problem.

@wuchong
wuchong merged commit d111c61 into apache:main Nov 16, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[server] Implement consumer group management APIs

2 participants