lucasbru commented on code in PR #22552:
URL: https://github.com/apache/kafka/pull/22552#discussion_r3418882759


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroupHeartbeatResult.java:
##########
@@ -26,20 +26,40 @@
 /**
  * A simple record to hold the result of a StreamsGroupHeartbeat request.
  *
- * @param data                  The data to be returned to the client.
- * @param creatableTopics       The internal topics to be created.
- * @param currentTopologyEpoch  The topology epoch the group is operating at 
after this heartbeat, or -1 if the
- *                              group has no topology yet. The service layer 
uses this to decide whether to set
- *                              TopologyDescriptionRequired on the response 
(KIP-1331).
+ * <p>The three epoch fields let the service layer decide, without re-reading 
the group,
+ * whether to set {@code TopologyDescriptionRequired} on the response: a push 
is needed
+ * when the stored epoch lags the current epoch and the same epoch has not 
already been
+ * recorded as a permanent failure. All three are -1 for failure-fast paths 
that do not
+ * resolve a group.
+ *
+ * @param data                              The data to be returned to the 
client.
+ * @param creatableTopics                   The internal topics to be created.
+ * @param currentTopologyEpoch              The topology epoch the group is 
operating at after this heartbeat,
+ *                                          or -1 if the group has no topology 
yet.
+ * @param storedDescriptionTopologyEpoch    The most recent topology epoch 
successfully stored by the topology
+ *                                          description plugin, or -1 if none.
+ * @param failedDescriptionTopologyEpoch    The most recent topology epoch the 
plugin permanently rejected,
+ *                                          or -1 if none.
  */
 public record StreamsGroupHeartbeatResult(
     StreamsGroupHeartbeatResponseData data,
     Map<String, CreatableTopic> creatableTopics,
-    int currentTopologyEpoch
+    int currentTopologyEpoch,

Review Comment:
   These three trailing epochs are all ints, and the 1-arg convenience ctor 
fills them with -1. A future construction site that transposes two of them, or 
uses the convenience ctor on a real-group path, compiles clean and silently 
disables (or wrongly triggers) solicitation. Might be worth an epoch-bundle 
type, or deriving the epochs from the group in GMM, rather than three 
positional ints at each site.



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