sodonnel commented on a change in pull request #2889:
URL: https://github.com/apache/ozone/pull/2889#discussion_r763906217



##########
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockInputStream.java
##########
@@ -256,11 +254,16 @@ protected synchronized int 
readWithStrategy(ByteReaderStrategy strategy)
 
     int totalRead = 0;
     while(strategy.getTargetLength() > 0 && remaining() > 0) {
-      int currentIndex = currentStreamIndex();
-      BlockExtendedInputStream stream = getOrOpenStream(currentIndex);
-      int read = readFromStream(stream, strategy);
-      totalRead += read;
-      position += read;
+      try {
+        int currentIndex = currentStreamIndex();
+        BlockExtendedInputStream stream = getOrOpenStream(currentIndex);
+        int read = readFromStream(stream, strategy);
+        totalRead += read;
+        position += read;
+      } catch (IOException ioe) {

Review comment:
       If it throws the above error, then it indicates the block is corrupt in 
some way. So while the datanode is not bad, it is still not usable by the 
reader, so it should exclude it and failover. That will happen, as the IOE will 
get caught in the calling method and it will throw a BadLocationException 
instead.




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