diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 2942823cbf7..559a3539a32 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1743,6 +1743,9 @@ Release 2.8.0 - UNRELEASED HDFS-9788. Incompatible tag renumbering in HeartbeatResponseProto. (wang) + HDFS-9790. HDFS Balancer should exit with a proper message if upgrade is + not finalized. (Xiaobing Zhou via Arpit Agarwal) + Release 2.7.3 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java index 8be62ac992e..60e70f49169 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java @@ -585,6 +585,8 @@ Result runOneIteration() { // Should not run the balancer during an unfinalized upgrade, since moved // blocks are not deleted on the source datanode. if (!runDuringUpgrade && nnc.isUpgrading()) { + System.err.println("Balancer exiting as upgrade is not finalized, " + + "please finalize the HDFS upgrade before running the balancer."); return newResult(ExitStatus.UNFINALIZED_UPGRADE, bytesLeftToMove, -1); }