eatmoreduck opened a new pull request, #24212:
URL: https://github.com/apache/kafka/pull/24212

   `EndpointToPartitionsManager#endpointToPartitions` unwrapped 
`configuredTopology().flatMap(ConfiguredTopology::subtopologies)` with 
`Optional#get`. When the topology is not configured yet, or its topic 
configuration failed and it carries no subtopologies — for example because 
source topics do not missing — the Optional is empty and the call throws 
`NoSuchElementException`. A member with a user endpoint (`application.server`) 
then fails its heartbeat with `UNKNOWN_SERVER_ERROR`, which the Streams client 
treats as fatal, so the application stops instead of waiting for the topics to 
appear. Members without an endpoint receive the regular `MISSING_SOURCE_TOPICS` 
status. Since `buildEndpointToPartitions` computes the mapping for every member 
of the group, one member with an endpoint breaks the heartbeats of all of them.
   
   The mapping is now computed against an empty subtopology map in that state. 
No task is assigned before the topology is configured, so the 
endpoint-to-partitions entry reports no partitions and the heartbeat returns 
the regular missing-source-topics status.
   
   Testing:
   
   - New parameterized 
`EndpointToPartitionsManagerTest#testEndpointToPartitionsWhenTopologyHasNoSubtopologies`
 covers both empty shapes (topology absent, and topology present with empty 
subtopologies); both fail with `NoSuchElementException` on trunk and pass with 
the fix.
   - Full `:group-coordinator:test` module passes: 2501 tests, 0 failures.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to