Repository navigation
Description
Bug description
In a cluster, StoreConsumerOffset from the Go SDK for a consumer group fails
with ConsumerGroupPartitionNotOwned when the partition's primary is not the
node the client is connected to (the metadata leader). The member does own the
partition. After the failure the client is no longer a member of the group.
What happens:
- The client is connected to the metadata leader (the coordinator) and has
joined groupg, which owns partition 0. StoreConsumerOffset(group g, partition 0)goes out on the coordinator
session. The coordinator is not partition 0's primary, so it answers
TransientNotAccepted.sendFramewalks the roster (settleOnNextEndpoint) and reconnects to the
partition primary. The reconnect registers a new client identity.- The replayed commit comes from that new identity, which is not a member.
The server refuses it:consumer group member with client id: 0 does not own partition: 0 at the current generation (rebalance in progress). The server
logs the real client id, e.g.Consumer group member with client ID: 3440707279 does not own partition: 0 ... operation=StoreConsumerOffset. - The session has moved off the coordinator, and the group membership belongs
to the old identity. From then on, group polls return the re-sync sentinel,
SyncConsumerGroupreturnsConsumerGroupMemberNotFound, and every later
commit is refused until the caller callsJoinConsumerGroupagain.
Expected: the commit reaches the partition primary, and the member keeps its
identity, its session on the coordinator and its membership. This is what the
Rust SDK does: store_consumer_offset goes through
PollRouter::write_offset over the consumer-session data connection, and
assert_group_offset_routing in partition_primary_routing.rs checks exactly
this. It is also what the Go SDK already does for auto-commit polls
(pollPrimary plus consumer-session attachment, covered by
TestE2E_SplitPrimaryPollsPreserveCoordinatorMembership).
Actual: manual commits (and DeleteConsumerOffset, which uses the same
path) go through the generic c.do failover. They lose the membership and are
refused.
A consumer that commits only after its output acknowledges (at-least-once, no
auto-commit) cannot store progress for such partitions at all.
Affected area / component
Go SDK, Clustering / replication
Deployment
Compiled from source (the integration harness). Also reproduced against the
DockerHub images.
Versions
master@5d8129e95: failing test below (the Go SDK inforeign/goat
that commit)- DockerHub
apache/iggy:0.9.0(sha256:b35fc284…) with Go SDKv0.9.0, and
apache/iggy:edge(sha256:8cc2475a…, revision85a397d0) with Go SDK
v0.9.1-0.20260924080616-85a397d0e5fd.foreign/gois unchanged between
v0.9.0and master.
Hardware / environment
Integration harness (3 nodes) in a Linux arm64 container (rust:1.98,
Go 1.25). Also seen on a 3-node Docker cluster on macOS: after a leader failover
in a long-running consumer, and on some freshly started clusters, whenever a
partition's primary differed from the metadata leader.
Sample code
require.NoError(t, client.JoinConsumerGroup(ctx, stream, topic, groupID))
consumer := iggcon.NewGroupConsumer(groupID)
partition := uint32(0)
// Partition 0's primary is not the node the client is connected to.
err := client.StoreConsumerOffset(ctx, consumer, stream, topic, 0, &partition)
// err: consumer group member with client id: 0 does not own partition: 0 at the
// current generation (rebalance in progress).
// The connection moved from the coordinator to the partition primary.Logs
--- FAIL: TestE2E_SplitPrimaryManualCommitPreservesMembership (4.11s)
Error: Received unexpected error:
consumer group member with client id: 0 does not own partition: 0 at the current generation (rebalance in progress).
Messages: manual group commit of offset 0 must reach the partition primary as a member (session 127.0.0.1:20016 -> 127.0.0.1:20000)
server: WARN shard-3 server::dispatch::partition: partition request with unresolved namespace; replying denied
error=Consumer group member with client ID: 3440707279 does not own partition: 0 at the current generation (rebalance in progress). operation=StoreConsumerOffset
(client id: 0 / partition: 0 in the SDK's error string are placeholders. The
Go error type does not carry the server's values.)
Reproduction
The failing test is on branch test/go-group-offset-store-membership (PR linked
below). It reuses the existing split-primary fixture (seed_split_primaries),
which moves metadata leadership off partition 0's primary:
cargo build --bin iggy-server --bin iggy
cargo test -p integration --test mod \
given_split_primaries_when_go_group_commits_manually_should_preserve_membership \
-- --ignoredIt failed 3 of 3 runs. The existing auto-commit sibling
(given_split_primaries_when_go_group_auto_commits_should_preserve_membership)
passed in the same runs.
Contribution
- I'm willing to submit a pull request to fix this bug
(the failing test is in the linked PR; the fix is left to the SDK maintainers)
Activity
almostintuitive commentedon Sep 24, 2026
Failing test for this (no fix; suggested fix in a
TODO(#4292)inStoreConsumerOffset): #4293fix(go): stop manual commits and cancels from dropping membership
fix(go): stop manual commits and cancels from dropping membership
fix(go): stop abandoned requests from stalling or resending
fix(go): stop manual commits and cancels from dropping membership
fix(go): stop abandoned requests from stalling or resending
fix(go): stop manual commits and cancels from dropping membership
fix(go): stop abandoned requests from stalling or resending
fix(go): stop abandoned requests from stalling or resending
fix(sdk): preserve sessions and prevent unsafe poll replay
test(go): require split primaries and a real run in the Go #4292 gate