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

   A streams group member that sets application.server received 
UNKNOWN_SERVER_ERROR on heartbeat while the group's configured topology had no 
subtopologies, for example because the source topics do not exist. Computing 
the endpoint-to-partitions mapping reads the configured subtopologies 
unconditionally, which throws NoSuchElementException for an empty Optional. 
Because the mapping is built for all members of the group, one member with an 
endpoint also broke the heartbeats of the others. A client always hits this on 
its first heartbeat, since it sends -1 as the endpoint information epoch and 
the group starts at 0.
   
   While the group's topology is not ready, the target assignment is empty, so 
there are no partitions to report. buildEndpointToPartitions therefore returns 
an empty list whenever the configured topology is absent or not ready, which 
covers both missing source topics and missing internal topics. The heartbeat 
then returns the usual status for the missing topics, and the mapping is 
delivered once the topology is ready and tasks are assigned, because the 
assignment change bumps the group's endpoint information epoch.
   
   Heartbeat tests cover a member with a user endpoint joining while a source 
topic is missing, which fails with NoSuchElementException without the change, 
the follow-up heartbeat after the topic is created, which delivers the real 
mapping, and the deletion of a source topic from a running group, where the 
member's tasks are revoked and clients receive an empty mapping with a bumped 
epoch. A unit test on StreamsGroup checks that no mapping is built without a 
configured topology, with missing source topics and with missing internal 
topics, and that every member with an endpoint is reported once the topology is 
ready.
   


-- 
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