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

Todd Lipcon commented on HDFS-2983:
-----------------------------------

- Can VersionUtil be made abstract, since it only has static methods?

----

{code}
+   * This function splits the two versions on "." and performs a lexical
+   * comparison of the resulting components.
{code}

Technically the quote characters inside the Javadoc should be " - or you 
could just use single-quotes instead to avoid the hassle.

----

VersionUtil should be doing numeric comparison rather than straight string 
comparison. For example "10.0.0" should be considered greater than "2.0", but I 
think the current implementation doesn't implement this correctly.

Please add a test for this case to TestVersionUtil as well.

----
{code}
+  private static void assertExpectedValues(String lower, String higher) {
+    assertTrue(0 > VersionUtil.compareVersions(lower, higher));
+    assertTrue(0 < VersionUtil.compareVersions(higher, lower));
+  }
{code}
These comparisons read backwards to me. ie should be:
{code}
+  private static void assertExpectedValues(String lower, String higher) {
+    assertTrue(VersionUtil.compareVersions(lower, higher) < 0);
+    assertTrue(VersionUtil.compareVersions(higher, lower) > 0);
+  }
{code}
don't you think?

----

{code}
+    if (VersionUtil.compareVersions(dnVersion, minimumDataNodeVersion) < 0) {
+      IncorrectVersionException ive = new IncorrectVersionException(
+          minimumDataNodeVersion, dnVersion, "DataNode", "NameNode");
+      LOG.warn(ive.getMessage());
+      throw ive;
+    }
{code}

Here, does the log message end up including the remote IP address somehow? If 
not, I think we should improve it to include that (and maybe the stringified 
DatanodeRegistration object)

                
> Relax the build version check to permit rolling upgrades within a release
> -------------------------------------------------------------------------
>
>                 Key: HDFS-2983
>                 URL: https://issues.apache.org/jira/browse/HDFS-2983
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: Eli Collins
>            Assignee: Aaron T. Myers
>         Attachments: HDFS-2983.patch, HDFS-2983.patch, HDFS-2983.patch
>
>
> Currently the version check for DN/NN communication is strict (it checks the 
> exact svn revision or git hash, Storage#getBuildVersion calls 
> VersionInfo#getRevision), which prevents rolling upgrades across any 
> releases. Once we have the PB-base RPC in place (coming soon to branch-23) 
> we'll have the necessary pieces in place to loosen this restriction, though 
> perhaps it takes another 23 minor release or so before we're ready to commit 
> to making the minor versions compatible.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to