From 56b88b06705441f6f171eec7fb2fa77946ca204b Mon Sep 17 00:00:00 2001 From: Weiwei Yang Date: Wed, 1 Nov 2017 16:41:45 +0800 Subject: [PATCH] HDFS-12744. More logs when short-circuit read is failed and disabled. Contributed by Weiwei Yang. --- .../org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java | 3 ++- .../org/apache/hadoop/hdfs/server/datanode/DataXceiver.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java index 5a22c331a6..6f3fc611a7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java @@ -646,7 +646,8 @@ private ShortCircuitReplicaInfo requestFileDescriptors(DomainPeer peer, default: LOG.warn(this + ": unknown response code " + resp.getStatus() + " while attempting to set up short-circuit access. " + - resp.getMessage()); + resp.getMessage() + ". Disabling short-circuit read for DataNode " + + datanode + " temporarily."); clientContext.getDomainSocketFactory() .disableShortCircuitForPath(pathInfo.getPath()); return null; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java index 3216a78b7b..b78fc9c7dc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java @@ -387,6 +387,8 @@ public void requestShortCircuitFds(final ExtendedBlock blk, } catch (IOException e) { bld.setStatus(ERROR); bld.setMessage(e.getMessage()); + LOG.error("Request short-circuit read file descriptor" + + " failed with unknown error.", e); } bld.build().writeDelimitedTo(socketOut); if (fis != null) {