From 7d46a806e71de6692cd230e64e7de18a8252019d Mon Sep 17 00:00:00 2001 From: Wangda Tan Date: Fri, 1 May 2015 16:40:44 -0700 Subject: [PATCH] YARN-3006. Improve the error message when attempting manual failover with auto-failover enabled. (Akira AJISAKA via wangda) --- .../src/main/java/org/apache/hadoop/ha/HAAdmin.java | 8 +++++++- hadoop-yarn-project/CHANGES.txt | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java index 9c28eb9ed4..aa19ee295f 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java @@ -279,7 +279,13 @@ private int failover(CommandLine cmd) "supported with auto-failover enabled."); return -1; } - return gracefulFailoverThroughZKFCs(toNode); + try { + return gracefulFailoverThroughZKFCs(toNode); + } catch (UnsupportedOperationException e){ + errOut.println("Failover command is not supported with " + + "auto-failover enabled: " + e.getLocalizedMessage()); + return -1; + } } FailoverController fc = new FailoverController(getConf(), diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index a21df9e21a..6f382017ff 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -189,6 +189,9 @@ Release 2.8.0 - UNRELEASED YARN-3469. ZKRMStateStore: Avoid setting watches that are not required. (Jun Gong via kasha) + YARN-3006. Improve the error message when attempting manual failover with + auto-failover enabled. (Akira AJISAKA via wangda) + BUG FIXES YARN-3197. Confusing log generated by CapacityScheduler. (Varun Saxena