From 4aa0609fb0c38494bae6c7f8aa6732e9a421b27c Mon Sep 17 00:00:00 2001 From: Daniel Templeton Date: Thu, 13 Dec 2018 16:20:36 +0100 Subject: [PATCH] HDFS-13985. Clearer error message for ReplicaNotFoundException (Contributed by Adam Antal via Daniel Templeton) Change-Id: I68ae7a5bedecbc204c161fc3b3ce8878fe5d493d --- .../hdfs/server/datanode/ReplicaNotFoundException.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/server/datanode/ReplicaNotFoundException.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/server/datanode/ReplicaNotFoundException.java index 946950ce62..b2f170ba0d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/server/datanode/ReplicaNotFoundException.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/server/datanode/ReplicaNotFoundException.java @@ -40,13 +40,19 @@ public class ReplicaNotFoundException extends IOException { "Replica does not exist "; public final static String UNEXPECTED_GS_REPLICA = "Cannot append to a replica with unexpected generation stamp "; + public final static String POSSIBLE_ROOT_CAUSE_MSG = + ". The block may have been removed recently by the balancer " + + "or by intentionally reducing the replication factor. " + + "This condition is usually harmless. To be certain, please check the " + + "preceding datanode log messages for signs of a more serious issue."; + public ReplicaNotFoundException() { super(); } public ReplicaNotFoundException(ExtendedBlock b) { - super("Replica not found for " + b); + super("Replica not found for " + b + POSSIBLE_ROOT_CAUSE_MSG); } public ReplicaNotFoundException(String msg) {