lucasbru commented on code in PR #24166:
URL: https://github.com/apache/kafka/pull/24166#discussion_r4600901259
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroup.java:
##########
@@ -239,14 +239,20 @@ public static class DeadlineAndEpoch {
private final Map<String, MemberTaskOffsets> taskOffsets = new HashMap<>();
/**
- * The version of the latest streams group heartbeat of each member, keyed
by member ID, which tells the
- * {@link AssignmentRefiner} which members report their task offsets. A
member that is missing has not heartbeated
- * since the coordinator loaded the group. Like {@link #taskOffsets}, it
is transient: written in the heartbeat
- * path, dropped when the member is removed and lost on coordinator
failover. It is not persisted, so that it can
- * never outlive the client that sent it.
+ * The version of the latest streams group heartbeat of each member, keyed
by member ID. A member that is missing
+ * has not heartbeated since the coordinator loaded the group. Like {@link
#taskOffsets}, it is transient: written
+ * in the heartbeat path, dropped when the member is removed and lost on
coordinator failover. It is not persisted,
+ * so that it can never outlive the client that sent it.
*/
private final Map<String, Integer> heartbeatVersions = new HashMap<>();
+ /**
+ * The assignment epoch of the group when the coordinator loaded it, or -1
if the group was created after the load.
+ * The intermediate assignment of this epoch and of earlier ones was
derived by a previous coordinator and is lost,
+ * while members may already have reconciled to it.
+ */
+ private int assignmentEpochAtLoad = -1;
Review Comment:
Assignment epochs are never negative, so `-1` just means that no epoch
counts as being from before the load, and the comparison needs no special case.
An `OptionalInt` would add a presence check without making anything safer, so I
would keep it as is.
--
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]