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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java:
##########
@@ -415,8 +415,21 @@ public List<ContainerWithPipeline> 
getExistContainerWithPipelinesInBatch(
         ContainerWithPipeline cp = getContainerWithPipelineCommon(containerID);
         cpList.add(cp);
       } catch (IOException ex) {
-        //not found , just go ahead
-        LOG.error("Container with common pipeline not found: {}", ex);
+        // Pipeline lookup failed (e.g., QUASI_CLOSED container whose pipeline
+        // has already been cleaned up). Return the container metadata without 
a
+        // pipeline so that callers (e.g., Recon's sync) can still record the
+        // container rather than losing it silently.
+        LOG.warn("Pipeline lookup failed for container {}; returning container 
"
+            + "without pipeline. Cause: {}", containerID, ex.getMessage());
+        try {
+          ContainerInfo info = scm.getContainerManager()
+              .getContainer(ContainerID.valueOf(containerID));
+          cpList.add(new ContainerWithPipeline(info, null));

Review Comment:
   Yeah, this can be problem, because the protobuf requires pipeline, so the 
whole RPC response can fail with NPE. Actually now we need to think , if we 
want Recon to receive container metadata without pipeline, we might need to 
change the API contract. 
   - add a new response type with ContainerInfoProto and optional Pipeline
   - or add a Recon-specific API that returns existing container metadata 
independently from pipeline
   
   Excluding that container means Recon will not add that specific container in 
this batch pass if SCM cannot resolve a pipeline for it. That is a limitation.
   
   IMO, we should add a new response type with ContainerInfoProto and optional 
Pipeline. What do you think ?



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