Skip to content

Conversation

@AndrewJSchofield
Copy link
Member

@AndrewJSchofield AndrewJSchofield commented Oct 25, 2025

Admin client changes for KIP-1226 which adds lag information for share
groups.

Reviewers: Lianet Magrans [email protected]

@AndrewJSchofield AndrewJSchofield changed the title KAFKA-19802: Admin client changes for KIP-1226 KAFKA-19802: WIP - Admin client changes for KIP-1226 Oct 25, 2025
@AndrewJSchofield AndrewJSchofield changed the title KAFKA-19802: WIP - Admin client changes for KIP-1226 KAFKA-19802: Admin client changes for KIP-1226 Oct 29, 2025
Copy link
Member

@lianetm lianetm left a comment

Choose a reason for hiding this comment

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

Thanks! Just nits on the comments, LGTM.

private final Optional<Long> lag;

/**
* Construct a new StartPartitionOffsetInfo.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Construct a new StartPartitionOffsetInfo.
* Construct a new SharePartitionOffsetInfo.

* Construct a new StartPartitionOffsetInfo.
*
* @param startOffset The share-partition start offset
* @param leaderEpoch The optional leader epoch of the start offset
Copy link
Member

Choose a reason for hiding this comment

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

I expect this is the leader epoch of the share partition, correct?

@AndrewJSchofield AndrewJSchofield removed the request for review from apoorvmittal10 November 3, 2025 19:35
@AndrewJSchofield AndrewJSchofield merged commit cfe85c2 into apache:trunk Nov 4, 2025
20 checks passed
@AndrewJSchofield AndrewJSchofield deleted the KAFKA-19802 branch November 4, 2025 14:11
Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@AndrewJSchofield thanks for this patch. I have two small questions. Please take a look.

groupOffsetsListing.put(tp, null);
} else {
groupOffsetsListing.put(tp, new OffsetAndMetadata(startOffset, leaderEpoch, ""));
groupOffsetsListing.put(tp, new SharePartitionOffsetInfo(startOffset, leaderEpoch, Optional.empty()));
Copy link
Member

Choose a reason for hiding this comment

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

Pardon me, will the lag be implemented later?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Very soon. https://issues.apache.org/jira/browse/KAFKA-19778 for the tasks we are implementing in parallel.

/**
* Construct a new SharePartitionOffsetInfo.
*
* @param startOffset The share-partition start offset
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I'm a bit confused by this "start offset". For example, If a partition has a latest offset of 23547540 and a share consumer has a "start offset" of 23541472, how do we explain the difference between those numbers?

chia7712@fedora:~/project/kafka$ ./bin/kafka-get-offsets.sh --bootstrap-server localhost:20000 --topic chia
chia:0:23547540
chia7712@fedora:~/project/kafka$ ./bin/kafka-share-groups.sh  --bootstrap-server localhost:20000 --offsets --describe --all-groups

GROUP               TOPIC           PARTITION  START-OFFSET  LAG
perf-share-consumer chia            0          23541472      -

Copy link
Member Author

Choose a reason for hiding this comment

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

The start offset is a little like the committed offset for a consumer group. The lag is the number of records to be delivered between the start offset and the latest offset.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants