feat(server): store offsets of groups managed outside Iggy - #4392
Open
krishvishal wants to merge 2 commits into
Open
krishvishal wants to merge 2 commits into
krishvishal wants to merge 2 commits into
Conversation
A new ExternalGroup consumer kind lets the Kafka gateway commit offsets for a group it never joins, with no hold on retention.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4392 +/- ##
============================================
- Coverage 87.96% 87.90% -0.06%
Complexity 1579 1579
============================================
Files 1290 1290
Lines 230145 230276 +131
Branches 193480 193612 +132
============================================
- Hits 202440 202429 -11
- Misses 22980 23092 +112
- Partials 4725 4755 +30
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR address?
Relates to #3542
Rationale
The Kafka gateway needs to keep a committed offset for every Kafka group, topic and partition. The accepted design in
gateways/kafka/docs/OFFSET_STORAGE.mdstores it as an Iggy consumer group offset underkafka.cg.<group>. That kind does not fitthe gateway:
Nextskips one record per partition, and only a naming rule stops it.The gateway handlers and the update to that design doc come in a separate PR.
What changed?
Group offsets had to come from a member of an Iggy consumer group, inside the partition's range, and they held back retention. A new consumer kind,
ExternalGroup(wire value 3,Consumer::external_groupin the Rust SDK), now stores offsets for a group that lives outside Iggy. The key is the numeric id of an existing Iggy consumer group, so the gateway still creates that group but never joins it. These offsets have their own key space, so they never share a key with the group's own offsets.For this kind the server:
FeatureUnavailableThe server replicates these offsets, recovers them at boot from
offsets/external_groups/, carries them in partition state transfer, and clears them on a purge. Boot creates that directory for a partition that an older build made. The HTTP clientreturns
FeatureUnavailablefor this kind, because the REST API cannot name a consumer kind. The CLI accepts--kind external-group.Some changes elsewhere follow from the new kind:
offsets/after the kind directories. The commit walk syncs it once per walk, not once per kind.