GH-4190 Add support to KIP-848#4233
Conversation
|
Code Review — GH-4190 Add support to KIP-484 (Kafka consumer group protocol) Thanks for this! Exposing 🔴 CI/test infrastructure likely cannot run the new
However, both 🟠 if (groupProtocol == GroupProtocol.Classic)
{
_consumerConfig.PartitionAssignmentStrategy = partitionAssignmentStrategy;
_consumerConfig.SessionTimeoutMs = ...;
}
else if (groupProtocol == GroupProtocol.Consumer)
{
_consumerConfig.GroupProtocol = groupProtocol;
_consumerConfig.GroupRemoteAssignor = groupRemoteAssignor;
_consumerConfig.GroupInstanceId = groupInstanceId; // only applied here
}Static membership ( 🟠 Mismatched settings are dropped without warning If 🟡 Behavior change: default - PartitionAssignmentStrategy partitionAssignmentStrategy = PartitionAssignmentStrategy.RoundRobin,
+ PartitionAssignmentStrategy? partitionAssignmentStrategy = null,For callers constructing 🟡 Test coverage: no broker-free unit test for the config mapping The core of this PR is the branching that maps protocol to
This locks in the mapping without a KIP-848-capable broker (and sidesteps the CI concern above). Per CLAUDE.md TDD workflow, this branching logic is the natural place for a unit test. 🟢 Minor / nits
Overall the API surface and wiring look correct; the main blockers are confirming the CI broker can exercise the 🤖 Automated review by Claude Code (Opus 4.8). Please verify findings against a real broker before acting. |
Review: GH-4190 Add support to KIP-484Thanks for this — exposing the new broker-coordinated consumer group protocol ( A few things worth considering: Design / correctness1. else if (groupProtocol == GroupProtocol.Consumer)
{
_consumerConfig.GroupProtocol = groupProtocol;
_consumerConfig.GroupRemoteAssignor = groupRemoteAssignor;
_consumerConfig.GroupInstanceId = groupInstanceId;
}Static membership ( 2. Broker-side enablement of the Consistency / minor3. New options are only settable via object initializer. 4. Provider duplication. 5. KIP number. The implemented feature — Nice touches
Nit: Overall this looks solid and well-tested; #1 (the 🤖 Generated with Claude Code |
Claude Code Review — PR #4233 (GH-4190 Add support to KIP-848)Thanks for this — the migration of the Kafka test infrastructure to KRaft and the addition of the new consumer group protocol is a clean, well-scoped change. Overall this looks good. A few observations, one of which I think is a genuine gap. 🐛 Potential bug —
|
iancooper
left a comment
There was a problem hiding this comment.
Nothing wrong with the way it is, so approved, but I would be interested if we could collate those parameters better.
Claude Code Review — PR #4233 (KIP-848 support)Thanks for this! The Bug —
|
|
Review: GH-4190 Add support to KIP-848 Thanks for this — the 🐛 Correctness / behaviour
🧪 Test coverage (per CLAUDE.md TDD guidance) The only coverage for the new types is the integration
Given CLAUDE.md marks the TDD workflow as mandatory, a small unit-test class over 🎨 Style / minor
✅ Nice touches
Overall the design is sound and the core config change is correct — the main asks are unit tests for the 🤖 Generated with Claude Code |
Code Review — GH-4190 Add support to KIP-848Thanks for this! The 👍 Strengths
🔧 Issues & suggestions1. (Medium) if (groupProtocol is ClassicGroupProtocol classicGroupProtocol)
{
classicGroupProtocol.SessionTimeout ??= sessionTimeout;
classicGroupProtocol.PartitionAssignmentStrategy ??= partitionAssignmentStrategy;
}This back-fills onto the user's object. Since 2. (Minor) Silent drop of deprecated params when a 3. (Minor) No 4. (Minor) License-header style inconsistency in the new files 5. (Minor) CI vs docker-compose divergence for schema-registry 6. (Nit) Unpinned 7. (Nit / pre-existing, not introduced here) In SummaryThe core design is sound and the feature is well-tested. The main thing I'd address before merge is #1 (mutation of the caller's protocol object); the rest are minor polish. Nice work adding KIP-848 support. 🤖 Automated review — please verify suggestions against your own judgment. |
Review: GH-4190 Add support to KIP-848Thanks for this — introducing an 🟠 Correctness / design1. The caller-supplied groupProtocol ??= new ClassicGroupProtocol();
if (groupProtocol is ClassicGroupProtocol classicGroupProtocol)
{
classicGroupProtocol.SessionTimeout ??= sessionTimeout;
classicGroupProtocol.PartitionAssignmentStrategy ??= partitionAssignmentStrategy;
}
Consider back-filling onto a local copy, or documenting explicitly that a 2. 🟡 CI / infrastructure3. 4. 5. Minor: 🟢 Nits
✅ Tests
Overall this is a solid, well-documented feature. The shared-instance mutation (1) is the item I would most like to see addressed or explicitly documented; the rest are minor. Reviewed with Claude Code. |
Review: GH-4190 Add support to KIP-848Thanks for this — the final shape (an 👍 What's good
🔍 Suggestions / questions1. The consumer mutates a caller-owned protocol object (medium). 2. Test coverage is broker-only for the new logic.
Note 3. Minor consistency nit in 4. Silent drop of deprecated params under the consumer protocol. 5. Broker version for the new Consumer tests. Nice work overall — the API evolution and deprecation handling are the strong points here. |
… since it uses async completion for non-existent topics
Code Review — GH-4190 Add support for KIP-848Thanks for this! The Correctness / design
Test coverage
CI / infra
Nits
Nothing here is blocking on the feature logic itself — the core 🤖 Generated with Claude Code |
…or Kafka since it uses async completion for non-existent topics" This reverts commit b6af50e.
Code Review — GH-4190: Add support for KIP-848 (Consumer Group Protocol)Thanks for this — the introduction of 👍 Strengths
🐛 Correctness / design notes
🧪 Test coverage
⚙️ CI / infrastructure
📝 Nits
Overall this is a solid, well-documented feature. The main asks are (1) add unit-level tests for the protocol Reviewed by Claude — automated PR review. |
Review of #4233 — Add support for KIP-848 (Kafka new consumer group protocol)Thanks for this — the Correctness / design
Test coverage
CI / infrastructure
Nice touches
Overall this is a solid, well-scoped feature. The main things I'd like to see addressed are the shared-instance mutation semantics (items 1–2) and a small unit test over 🤖 Automated review |
Code Review — KIP-848 support (Kafka consumer group protocol)Thanks for this — it's a clean, well-considered feature. The 👍 Strengths
🔎 Suggestions / questions1. In-place mutation of the caller's 2. Broker enablement of the consumer protocol (CI, please verify). 3. Mixed-vendor container stack (infra, minor). 4. Missing unit coverage for the actual behavior change (test coverage). ConsumerConfig? captured = null;
_ = new KafkaMessageConsumer(config, routingKey, groupId: "g",
groupProtocol: new ConsumerGroupProtocol(),
configHook: c => captured = c);
Assert.Equal(GroupProtocol.Consumer, captured!.GroupProtocol);
Assert.Null(captured.SessionTimeoutMs); // classic-only setting not leaked
Assert.Null(captured.PartitionAssignmentStrategy);This would guard the regression that matters most cheaply and without a broker. 5. Minor consistency nit. Overall: solid work, backward-compatible, and well-documented. My only near-blocking item is confirming the CI broker actually enables the consumer protocol (#2); the clone (#1) and the constructor-level unit test (#4) would be worthwhile hardening. 🤖 Automated review — generated with Claude Code |
Description
Add support for KIP-848 — Kafka's new consumer group protocol — alongside the existing classic protocol.
IGroupProtocolstrategy applied to theConsumerConfigat consumer creation:ClassicGroupProtocol(default): carriesSessionTimeout,HeartbeatInterval, andPartitionAssignmentStrategy. When no protocol is supplied, the consumer back-fills anynullproperties from its constructor parameters (session timeout default 10 s, assignment strategy defaultRoundRobin), preserving current behavior. The back-fill mutates the instance in place, so an instance must not be shared across subscriptions (documented on the type and onKafkaSubscription.GroupProtocol).ConsumerGroupProtocol(KIP-848): carriesGroupRemoteAssignorandGroupInstanceId, and deliberately does not setsession.timeout.ms,heartbeat.interval.ms, orpartition.assignment.strategy, which librdkafka rejects whengroup.protocol=consumer.KafkaSubscription.GroupProtocolselects the protocol; the legacySessionTimeoutandPartitionAssignmentStrategyproperties onKafkaSubscriptionare obsoleted (with#pragmaguards at call sites) in favor ofClassicGroupProtocol.GroupInstanceIdmust be unique per consumer instance — only set it with a single performer, or assign unique ids viaconfigHook), and the weaker infrastructure-validation guarantees of the consumer protocol (broker-driven membership completes asynchronously, soOnMissingChannel.Validatecannot reliably detect missing topics; preferCreateor provision topics out-of-band).Test infrastructure
apache/kafka, no ZooKeeper) indocker-compose-kafka.yamland the CI workflow; images pinned to explicit versions (apache/kafka:4.0.2,cp-schema-registry:8.0.6,cp-enterprise-control-center:7.9.8).ClassicGroupProtocol.Apply/ConsumerGroupProtocol.Applythat lock in the KIP-848 config contract (consumer protocol never sets the classic-only keys).KafkaMessageAssertionnow compares timestamps normalized to UTC seconds (the previous string comparison was timezone-sensitive).Related Issues
#4190
Type of Change
Checklist
Additional Notes
Addresses the automated review feedback: documented the
IGroupProtocolno-sharing contract and theGroupInstanceIdstatic-membership caveat, added unit tests over theApplymappings, pinned the Docker images, and fixed the cosmetic issues (trailing whitespace/newline, double space).