duongkame commented on code in PR #3800:
URL: https://github.com/apache/ozone/pull/3800#discussion_r1114687659


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockInputStream.java:
##########
@@ -187,19 +192,19 @@ public synchronized void initialize() throws IOException {
     }
   }
 
+  /**
+   * Check if this exception is because datanodes are not reachable.
+   */
+  private boolean isConnectivityIssue(IOException ex) {
+    return Status.fromThrowable(ex).getCode() == Status.UNAVAILABLE.getCode();
+  }
+
   private void refreshPipeline(IOException cause) throws IOException {
     LOG.info("Unable to read information for block {} from pipeline {}: {}",
         blockID, pipeline.getId(), cause.getMessage());
     if (refreshPipelineFunction != null) {
       LOG.debug("Re-fetching pipeline for block {}", blockID);
-      Pipeline newPipeline = refreshPipelineFunction.apply(blockID);
-      if (newPipeline == null || newPipeline.sameDatanodes(pipeline)) {
-        LOG.warn("No new pipeline for block {}", blockID);
-        throw cause;
-      } else {
-        LOG.debug("New pipeline got for block {}", blockID);
-        this.pipeline = newPipeline;
-      }

Review Comment:
   @adoroszlai, sorry I missed this. My intention was to remove the check for 
the same pipeline because it just doesn't make sense and fails some test cases. 
(Client talks to datanode and get an error, it then recontacts to OM and SCM 
and SCM say the current pipeline is ok, hence, the previous error with datanode 
may be just a temporary one, so just retry if the policy still allows).
   
   I wasn't aware of any case where the returned pipeline can be null, think I 
talked to someone to confirm it as well. Obviously you've caught a problem with 
it, as per HDDS-7982. Thanks.



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