devmadhuu commented on code in PR #10326:
URL: https://github.com/apache/ozone/pull/10326#discussion_r3377911708
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconContainerManager.java:
##########
@@ -210,28 +211,33 @@ void transitionOpenToClosing(ContainerID containerID,
ContainerInfo containerInf
pipelineToOpenContainer.put(pipelineID, curCnt - 1);
}
}
- updateContainerState(containerID, FINALIZE); // OPEN → CLOSING
}
/**
- * Check if an OPEN container should move to CLOSING based on a healthy
- * non-OPEN DN replica report.
+ * Check if Recon's container lifecycle state needs the Recon-specific
+ * pre-processing required before SCM's shared report handler processes the
+ * replica.
+ *
+ * <p>Recon only handles OPEN to CLOSING here to keep the per-pipeline open
+ * container count accurate. All other known-container lifecycle transitions
+ * are left to SCM's common ICR/FCR state machine, which is invoked after
this
+ * method by Recon's report handlers.
+ *
+ * @param containerID containerID to check
+ * @param replicaState replica state reported by a DataNode
*/
private void checkContainerStateAndUpdate(ContainerID containerID,
ContainerReplicaProto.State
replicaState)
throws IOException, InvalidStateTransitionException {
ContainerInfo containerInfo = getContainer(containerID);
HddsProtos.LifeCycleState reconState = containerInfo.getState();
- if (reconState != HddsProtos.LifeCycleState.OPEN
- || replicaState == ContainerReplicaProto.State.OPEN
- || !isHealthy(replicaState)) {
- return;
+ if (reconState == HddsProtos.LifeCycleState.OPEN
Review Comment:
Yes, this part is only a readability change. The condition is equivalent to
the previous early-return form: Recon still only performs OPEN -> CLOSING when
Recon has the container as OPEN and the DN reports a healthy non-OPEN replica.
No additional state transition behavior is introduced here.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]