chickenchickenlove commented on code in PR #24216:
URL: https://github.com/apache/kafka/pull/24216#discussion_r4584071716


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -2241,8 +2241,14 @@ private CoordinatorResult<StreamsGroupHeartbeatResult, 
CoordinatorRecord> stream
 
             if (reconfigureTopology || group.configuredTopology().isEmpty()) {
                 log.info("[GroupId {}][MemberId {}] Configuring the topology 
{}", groupId, memberId, updatedTopology.topologyEpoch());
+                Optional<Boolean> wasReady = 
group.configuredTopology().map(ConfiguredTopology::isReady);
                 updatedConfiguredTopology = 
InternalTopicManager.configureTopics(log, groupId, memberId, metadataHash, 
updatedTopology, metadataImage, time);
                 group.setConfiguredTopology(updatedConfiguredTopology);
+                // No endpoint information is reported while the topology is 
not ready, so members must refetch it
+                // when the topology becomes ready or stops being ready, even 
if no assignment changes.
+                if (wasReady.isPresent() && wasReady.get() != 
updatedConfiguredTopology.isReady()) {
+                    
group.setEndpointInformationEpoch(group.endpointInformationEpoch() + 1);

Review Comment:
   Um, maybe, we can consider a case where member `B` has `epoch = 1` and an 
empty endpoint mapping `[]` before coordinator failover.
   
   If so, after failover, the coordinator’s state becomes `epoch = 1` with an 
endpoint mapping of `[A, B, C]`, `B`’s next heartbeat would still carry `epoch 
= 1`, so the coordinator would skip sending the updated mapping. This seems to 
leave a small gap where `B` retains the empty mapping.
   
   It seems we could address this if we could distinguish whether the 
coordinator is still the same as before. 
   
   What do you think?



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