[ 
https://issues.apache.org/jira/browse/HDFS-7302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14334532#comment-14334532
 ] 

Tsz Wo Nicholas Sze commented on HDFS-7302:
-------------------------------------------

{code}
-      + RollingUpgradeStartupOption.getAllOptionString() + " ] | \n\t["
+      + RollingUpgradeStartupOption.getAllOptionString().replace("downgrade|", 
"") + " ] | \n\t["
{code}
I think we should remove the DOWNGRADE enum from RollingUpgradeStartupOption 
and add a check when parsing the string such as
{code}
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/HdfsServerConstants.java
@@ -65,6 +65,14 @@ public boolean matches(StartupOption option) {
     private static final RollingUpgradeStartupOption[] VALUES = values();
 
     static RollingUpgradeStartupOption fromString(String s) {
+      if ("downgrade".equalsIgnoreCase(s)) {
+        throw new IllegalArgumentException(
+            "The \"downgrade\" option is no longer supported"
+            + " since it may incorrectly finalize a ongoing rolling upgrade."
+            + " For downgrade instruction, please see the documentation"
+            + " (http://hadoop.apache.org/docs/current/hadoop-project-dist/";
+            + "hadoop-hdfs/HdfsRollingUpgrade.html#Downgrade).");
+      }
       for(RollingUpgradeStartupOption opt : VALUES) {
         if (opt.name().equalsIgnoreCase(s)) {
           return opt;
{code}


> namenode -rollingUpgrade downgrade may finalize a rolling upgrade
> -----------------------------------------------------------------
>
>                 Key: HDFS-7302
>                 URL: https://issues.apache.org/jira/browse/HDFS-7302
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Kai Sasaki
>              Labels: document, hdfs
>         Attachments: HADOOP-7302.1.patch
>
>
> The namenode startup option "-rollingUpgrade downgrade" is originally 
> designed for downgrading cluster.  However, running "namenode -rollingUpgrade 
> downgrade" with the new software could result in finalizing the ongoing 
> rolling upgrade.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to