xinglin commented on code in PR #6446:
URL: https://github.com/apache/hadoop/pull/6446#discussion_r1451261032
##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java:
##########
@@ -1494,19 +1533,39 @@ private int pread(long position, ByteBuffer buffer)
try {
if (dfsClient.isHedgedReadsEnabled() && !blk.isStriped()) {
hedgedFetchBlockByteRange(blk, targetStart,
- targetEnd, buffer, corruptedBlocks);
+ targetEnd, buffer, corruptedBlocks, ioExceptionMap);
} else {
fetchBlockByteRange(blk, targetStart, targetEnd,
- buffer, corruptedBlocks);
+ buffer, corruptedBlocks, ioExceptionMap);
}
- } finally {
+ } catch (IOException e) {
+ // When we reach here, it means we fail to fetch the current block
from all available
+ // datanodes. Send IOExceptions in ioExceptionMap to the log and
rethrow the exception to
+ // fail this request.
+ String msg = String.format("Failed to read from all available
datanodes for block %s "
Review Comment:
Thanks for the suggestion! Fixed.
--
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]