cli: show consumer group lag, and delete or reset consumer offsets
维护者通常 2 天内回复
@BlackPanther112358 已经在做这个了。
开始于 2026年10月22日。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
Start by reading the existing consumer-group get and consumer-offset get CLI paths, plus the referenced offset client and server handlers in core/common/src/traits/consumer_offset_client.rs and core/server/src/http/handlers.rs. The issue calls for several coordinated CLI and server changes; first clarify the proposed non-member rule for empty groups with maintainers. Done means the lag view, delete command, and safe preview-and-execute reset behavior are implemented, with tests and help text covering the retention risk.
由索引模型根据 Issue 内容生成。
描述
Problem
-
You cannot see consumer lag (the messages that a group did not consume yet).
consumer-group getshows members and partitions, but no offsets.consumer-offset getshows one partition per call. -
The CLI cannot delete a consumer offset. The SDK (
core/common/src/traits/consumer_offset_client.rs:65) and the binary protocol (code 122) support it. The HTTP API deletes only regular consumer offsets (core/server/src/http/handlers.rs:1530). -
The CLI cannot set a consumer group offset. Over TCP, QUIC and WebSocket,
consumer-offset set -k consumer-groupfails with error 5009, because the CLI is not a member of the group (core/server/src/namespace.rs:280):Consumer group member with client ID: 0 does not own partition: 0 at the current generation (rebalance in progress).No rebalance runs, because the group has no members. Binary errors carry only the code, so the client fills the fields with zeros (#3735). Over HTTP, the same command writes a regular consumer offset instead (#4408).
-k external-groupworks, but Iggy consumer groups never read external group offsets (#4392).
Proposal
- Add a partitions table to
consumer-group get: partition, member, current offset, stored offset and lag. A client does not need to be a member to read a group offset. The stored offset is the last consumed offset, so the lag is the current offset minus the stored offset. If no offset is stored, the lag is the message count of the partition. - Add
consumer-offset delete, with the same arguments asconsumer-offset get. - Server: if the group has no members, accept an offset write or delete for it from a non-member. If the group has members, keep the current fence. The Kafka admin API has the same rule: it resets the offsets of an empty group only.
- Add
consumer-group reset <STREAM_ID> <TOPIC_ID> <GROUP_ID>with--to-earliest,--to-latest,--to-offset <N>or--to-timestamp <TIME>. Print the plan first, and write it only with--execute. --to-offset NstoresN - 1, because the next poll starts after the stored offset.--to-earliestand--to-offset 0delete the offset.
Notes
- Agree on the server rule before coding. The lag view does not depend on it. Until the rule exists,
consumer-offset deleteworks only for regular consumers and external groups. - The membership check and the offset write are not atomic, so a consumer that joins during a reset can overwrite it. Before a reset, stop all consumers of the group and wait for
consumer_group.session_timeout. - An offset write needs only the poll permission. With the new rule, any user who can poll the topic can reset an idle group.
- A stored group offset holds back retention. If a reset deletes it, retention can remove messages that the group did not read. The help text must say this.
- Over HTTP, the group kind is lost (#4408), so the lag view needs TCP, QUIC or WebSocket until #4279 is done. Offset reads come from the local replica, so the lag can be stale (#4409).
- 主要语言
- Rust
- 星标
- 5.3k
- 派生
- 548
- 平均合并
- 2 天 20 小时
- 30 天内合并 PR
- 194
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/iggy 的其他 Issue
-
go good first issue test
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
go good first issue test
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 2 天内回复
-
go good first issue test
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
good first issue java test
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 2 天内回复
-
good first issue javascript test
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 2 天内回复
相似的 Issue
-
marketing
难度 2/5 半天 新手友好度 62/100
维护者通常 1 天内回复
-
S: Untriaged T: Bug
难度 2/5 1-3 小时 新手友好度 72/100
libnyanpasu/clash-nyanpasu#6537 ·
维护者通常 1 天内回复
-
难度 2/5 1 小时以内 新手友好度 62/100
tauri-apps/tao#1445 ·
维护者通常 1 天内回复
-
bug P3
难度 1/5 1-3 小时 新手友好度 88/100
-
难度 1/5 1 小时以内 新手友好度 65/100
nearai/compose-manager#95 ·
维护者通常 1 天内回复