lucasbru opened a new pull request, #21526: URL: https://github.com/apache/kafka/pull/21526
When the endpoint information epoch known to a member is outdated, the broker recomputes the endpoint-to-partitions mapping for all members from scratch. This is expensive because it happens for each member individually as they catch up to the new epoch. This commit adds a per-member cache for endpoint-to-partitions results in StreamsGroup, keyed by member ID. Cache entries are explicitly invalidated when a member's assigned tasks change, when a member is removed, or when the configured topology changes. The computation and endpoint building logic is moved from GroupMetadataManager into StreamsGroup. This keeps the cache management colocated with the member lifecycle methods that need to invalidate it (updateMember, removeMember, setConfiguredTopology), and also avoids the overhead of the Collections.unmodifiableMap wrapper returned by the public members() accessor. Tests cover cache population, retrieval, and invalidation on task change, member removal, topology change, and preservation when tasks are unchanged. -- 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]
