justinmclean opened a new issue, #4462:
URL: https://github.com/apache/iggy/issues/4462

   Split from #4447.
   
   ## Problem
   
   You cannot see consumer lag (the messages that a group did not consume yet). 
`iggy consumer-group get` shows members and partitions, but no offsets 
(`core/cli/src/commands/binary_consumer_groups/get_consumer_group.rs`). 
`consumer-offset get` shows one partition per call.
   
   ## Proposal
   
   Add a partitions table to `consumer-group get`, one row per partition of the 
topic: partition, member, current offset, stored offset and lag.
   
   - Read each offset with `get_consumer_offset` and a `Consumer` of kind 
`ConsumerGroup`. A client does not need to be a member to read a group offset. 
The result is `ConsumerOffsetInfo` 
(`core/common/src/types/consumer/consumer_offset_info.rs:26`).
   - The stored offset is the last consumed offset, so the lag is the current 
offset minus the stored offset.
   - If no offset is stored, show `-` for the stored offset, and use the 
message count of the partition as the lag.
   - The member column comes from the members list that the command already 
reads.
   
   ## Notes
   
   - Over HTTP the group kind is lost (#4408), so the table is only correct 
over TCP, QUIC and WebSocket for now. Offset reads come from the local replica, 
so the lag can be stale (#4409).
   - The offset reset and delete parts of #4447 stay there. They need a server 
change first.
   
   ## Acceptance
   
   - `consumer-group get` shows the partitions table for a group with and 
without stored offsets.
   - The lag matches the messages a group member would still poll.
   - 
`core/integration/tests/cli/consumer_group/test_consumer_group_get_command.rs` 
covers both cases and passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to