Repository navigation
feat(gateways): share Kafka consumer groups across multiple gateways in Iggy - #4681
Conversation
10aad01 to
645c78b
Compare
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (42.85%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #4681 +/- ##
=========================================
Coverage 90.99% 90.99%
+ Complexity 3862 3857 -5
=========================================
Files 1555 1556 +1
Lines 400903 400926 +23
Branches 334849 334881 +32
=========================================
+ Hits 364798 364819 +21
+ Misses 28799 28780 -19
- Partials 7306 7327 +21
🚀 New features to boost your workflow:
|
|
/skill team-review |
There was a problem hiding this comment.
Summary: The review found five defects in the new group restore and coordinator log paths, plus documentation and API surface nits. They cover the restored member protocol list, unbounded offset deletion markers, a per-batch checkpoint scan, an unvalidated coordinator log topic, and topic deletions lost on a broadcast lag.
Counts: critical 0, warning 5, nit 2, simplification 2
This review was generated by Claude Code 2.1.310 on deepseek-flash[1m]. Review the output before you act on it.
A partition leaves the answer when its handoff starts, so a member can stop serving it before the move completes.
A coordinator log in Iggy keeps each group's state and offsets, the metadata change log feeds the group index, and gateways split leaders.
…tor log Master added both to each member, so a group that moves to another gateway keeps them for DescribeGroups.
15ab8a4 to
a431714
Compare
Which issue does this PR address?
Relates to #4515
Rationale
Since #4662, every gateway lists the others, but one gateway still holds every consumer group in its memory. FindCoordinator names the gateway with the lowest node id. While that gateway is down, every group waits for it. When it restarts, it has lost every member, so every group rebalances.
For N gateways that cover for each other, the gateways must share the groups. Any gateway must take over the groups of a gateway that stops, with their members, generations and offsets. Kafka keeps this state in
__consumer_offsets, and a new coordinator replays it. This PR keeps it in an Iggy topic in the same way.What changed?
The gateways share their groups through a coordinator log: the Iggy topic
coordinators, with 16 partitions, in the stream<default stream>.meta. A hash of the group id picks the partition. Every gateway joins the Iggy consumer groupkafka-gatewayson that topic, and Iggy spreads the partitions over the gateways. No gateway polls through that group, so Iggy hands a partition over at once. A gateway that Iggy gives a partition reads it from its last checkpoint. Then it appends a claim, numbered above every claim before it. While its claim is the newest, it coordinates the groups of that partition.When the leader's SyncGroup completes a generation, the coordinator stores the whole group. The members get their assignments only after the gateway reads that record back. The coordinator also appends each offset commit, with its metadata and leader epoch, and each deletion. It reads each append back. If a newer claim comes before the record, the record does not count. The coordinator then answers NOT_COORDINATOR (16) and stops serving the partition. So a gateway that lost a partition cannot change it. Each owner follows its partitions with the waiting read of #4629. It writes a checkpoint after 10,000 records, and at least once a day. It announces itself on the topic
coordinator_owners, which every gateway reads.With that:
manage_servers, it scans as before. The change log also updates the permissions of open connections. A connection whose Iggy user is deleted now closes.The SDK gets
ConsumerGroupClient::get_consumer_group_assignment, a public read of the caller's own assignment. It sends the existing SyncConsumerGroup command, so the wire format and the server do not change. Over HTTP it returns FeatureUnavailable. It is a separate commit.IGGY_KAFKA_COORDINATOR_LOGturns the log on. It is on by default withIGGY_KAFKA_BROKERSand the bridge. With the log off, the gateway works as before.