[ 
https://issues.apache.org/jira/browse/KAFKA-21515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18148489#comment-18148489
 ] 

Matthias J. Sax edited comment on KAFKA-21515 at 11/23/26, 12:20 AM:
---------------------------------------------------------------------

Thanks for filing this ticket.

We noted the same issue on PR #24166: relabelRefinedAssignment runs in 
getOrMaybeCreateStaticStreamsGroupMember, before the last throws in the 
heartbeat handler, and isn't rolled back. Besides the topology mismatch 
(maybeUpdateTopology), throwIfRequestContainsInvalidTasks can also reject the 
request after the relabel. A retry with the same member ID heals; a rejoin with 
a new member ID gets an empty assignment until the next epoch bump.

Suggested fix: move the relabel into the handler after the last throw, using 
replaceStaticOldMember.

Do you want to pickup working on a fix? If not, [~lucasbru] or I would want to 
pick it up.


was (Author: mjsax):
Thanks for filing this ticket.

WE noted the same issue on PR #24166: relabelRefinedAssignment runs in 
getOrMaybeCreateStaticStreamsGroupMember, before the last throws in the 
heartbeat handler, and isn't rolled back. Besides the topology mismatch 
(maybeUpdateTopology), throwIfRequestContainsInvalidTasks can also reject the 
request after the relabel. A retry with the same member ID heals; a rejoin with 
a new member ID gets an empty assignment until the next epoch bump.

Suggested fix: move the relabel into the handler after the last throw, using 
replaceStaticOldMember.

Do you want to pickup working on a fix? If not, [~lucasbru] or I would want to 
pick it up.

> A Streams static rejoin rejected by topology validation causes a subsequent 
> valid rejoin to receive an empty task assignment
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-21515
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21515
>             Project: Kafka
>          Issue Type: Bug
>          Components: group-coordinator, streams
>            Reporter: sanghyeok An
>            Assignee: sanghyeok An
>            Priority: Minor
>
> When a Streams static member’s rejoin is rejected by topology validation, 
> changes made to the intermediate assignment cache can remain. A subsequent 
> member rejoining with the correct topology can therefore receive an empty 
> assignment in its first response, even though the previous task assignment is 
> available for inheritance.
> *Scenario*
>  # Static member A is operating normally and owns task T. The coordinator has 
> an intermediate assignment cached for the current assignment epoch.
>  # A temporarily leaves the group normally ({{{}memberEpoch=-2{}}}). The 
> coordinator preserves its member information and target assignment so they 
> can be inherited upon rejoining.
>  # Before the session expires, B rejoins with A’s instance ID and a new 
> member ID. Due to a deployment error, for example, B submits different 
> topology contents while retaining the existing topology epoch.
>  # While preparing the static member replacement, the coordinator changes the 
> intermediate assignment cache key from A to B. It then detects the topology 
> mismatch and rejects B’s request with {{{}STREAMS_INVALID_TOPOLOGY_EPOCH{}}}.
>  # B’s member replacement is not applied, so the stored member and target 
> assignment still refer to A. However, the intermediate assignment cache 
> retains B’s key.
>  # Before the session expires, C rejoins with the original topology restored, 
> the same instance ID and process ID, and a new member ID. The relevant 
> topology epoch, metadata, and assignment configuration remain unchanged.
>  # C’s rejoin succeeds, but the coordinator cannot find A’s cached entry to 
> transfer to C. The first response therefore contains an empty active 
> assignment instead of task T.
> Without B’s rejected join attempt, C receives the existing task T in its 
> first rejoin response. The cache mutation from the rejected request changes 
> the outcome of a subsequent valid request.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to