jolshan commented on code in PR #14090:
URL: https://github.com/apache/kafka/pull/14090#discussion_r1274093513


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/runtime/CoordinatorRuntime.java:
##########
@@ -1187,63 +1230,62 @@ public void scheduleLoadOperation(
     ) {
         throwIfNotRunning();
         log.info("Scheduling loading of metadata from {} with epoch {}", tp, 
partitionEpoch);
+
         // Touch the state to make the runtime immediately aware of the new 
coordinator.
-        getOrCreateContext(tp);
+        maybeCreateContext(tp);
 
         scheduleInternalOperation("Load(tp=" + tp + ", epoch=" + 
partitionEpoch + ")", tp, () -> {
-            CoordinatorContext context = getOrCreateContext(tp);
-
-            if (context.state == CoordinatorState.FAILED) {
-                // When the coordinator has failed, we create a new context 
instead of

Review Comment:
   I guess we clear it here (when loading):
   ```
    snapshotRegistry = new SnapshotRegistry(logContext);
    lastWrittenOffset = 0L;
    lastCommittedOffset = 0L;
    ```
    I guess my only other question was the motivation for this change. Did it 
turn out to be easier to reuse rather than create new after all? 



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to