devmadhuu commented on code in PR #10074:
URL: https://github.com/apache/ozone/pull/10074#discussion_r3152564409


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerStateManagerImpl.java:
##########
@@ -239,7 +239,8 @@ private void initialize() throws IOException {
         final ContainerInfo container = iterator.next();
         Objects.requireNonNull(container, "container == null");
         containers.addContainer(container);
-        if (container.getState() == LifeCycleState.OPEN) {
+        if (container.getState() == LifeCycleState.OPEN
+            && container.getPipelineID() != null) {

Review Comment:
   Earlier this path would throw NPE from `PipelineStateMap` because 
`addContainerToPipelineSCMStart` eventually requires a non-null `PipelineID`. 
The check is only to avoid failing SCM/Recon startup/reinitialize
   when an OPEN container record exists without `pipelineID`. The container is 
still added to the in-memory container map; only pipeline-to-container 
registration is skipped because there is no pipeline to register against.
   For normal `OPEN` containers with a `pipelineID`, behavior is unchanged. For 
a non-null but missing pipelineID, we still call 
`addContainerToPipelineSCMStart` and keep the existing 
`PipelineNotFoundException` handling, so Replication Manager's 
`OpenContainerHandler` can move it forward later.



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

Reply via email to