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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerStateManagerImpl.java:
##########
@@ -334,12 +339,16 @@ public void addContainer(final ContainerInfoProto 
containerInfo)
           transactionBuffer.addToBuffer(containerStore,
               containerID, container);
           containers.addContainer(container);
-          if (pipelineManager.containsPipeline(pipelineID)) {
+          if (pipelineID != null && 
pipelineManager.containsPipeline(pipelineID)) {
             pipelineManager.addContainerToPipeline(pipelineID, containerID);
           } else if (containerInfo.getState().
               equals(LifeCycleState.OPEN)) {
-            // Pipeline should exist, but not
-            throw new PipelineNotFoundException();
+            if (pipelineID != null) {

Review Comment:
   The throw is for the non-null pipelineID case where 
containsPipeline(pipelineID) is false. That means the container references a 
pipeline, but the pipeline is not present in the pipeline manager, so 
preserving `PipelineNotFoundException` is intentional and matches the old 
behavior.
   
   The null `pipelineID` case is handled separately because there is no 
pipeline key to look up or register against. For Recon sync we still want to 
record the container so it does not remain absent from Recon, but skip pipeline 
tracking and log a warning.



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