Skip to content

kfake: bump group epoch on topic change to ensure assignment resend#1259

Merged
twmb merged 1 commit intomasterfrom
kfake_again
Feb 18, 2026
Merged

kfake: bump group epoch on topic change to ensure assignment resend#1259
twmb merged 1 commit intomasterfrom
kfake_again

Conversation

@twmb
Copy link
Owner

@twmb twmb commented Feb 18, 2026

When a topic is created/deleted/partitioned, notifyTopicChange eagerly recomputes target assignments but did not bump g.generation. If the heartbeat response carrying the new assignment arrived before the client discovered the topic ID via metadata, the client skipped the unknown topic. The server recorded lastReconciledSent as delivered and never resent the assignment on subsequent keepalive heartbeats, permanently missing the topic.

Fix by bumping g.generation in notifyTopicChange (matching Kafka, which bumps the group epoch on target assignment changes) and resending the assignment while memberEpoch < generation. The member epoch only catches up when currentAssignment == targetAssignment, confirming the client processed the assignment.

When a topic is created/deleted/partitioned, notifyTopicChange eagerly
recomputes target assignments but did not bump g.generation. If the
heartbeat response carrying the new assignment arrived before the client
discovered the topic ID via metadata, the client skipped the unknown
topic. The server recorded lastReconciledSent as delivered and never
resent the assignment on subsequent keepalive heartbeats, permanently
missing the topic.

Fix by bumping g.generation in notifyTopicChange (matching Kafka, which
bumps the group epoch on target assignment changes) and resending the
assignment while memberEpoch < generation. The member epoch only catches
up when currentAssignment == targetAssignment, confirming the client
processed the assignment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@twmb twmb merged commit fd4189c into master Feb 18, 2026
13 checks passed
@twmb twmb deleted the kfake_again branch February 18, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments