adoroszlai commented on code in PR #3800:
URL: https://github.com/apache/ozone/pull/3800#discussion_r1114700454
##########
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:
No problem. The fix for HDDS-7982 restores the null check, but avoids
throwing exception for same pipeline case.
On the positive side, this change has also fixed HDDS-7089 where read after
datanode restart was failing intermittently. It turned out that
`sameDatanodes` ignores IP address change, only checks UUIDs.
--
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]