Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-20444

Improve version comparison logic for HBase specific version string and add unit tests

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0, 2.1.0, 1.5.0
    • Component/s: util
    • Labels:
      None

      Description

      As Sean Busbey commented on HBASE-18792, current logic for comparing version strings in class org.apache.hadoop.hbase.util.VersionInfo is generic and needs to be improved:

      if (index < s1.length) {
        // s1 is longer
        return 1;
      }
      

      I think this is wrong? like version "2.0.0" should be after "2.0.0-SNAPSHOT". it's also after "2.0.0-alpha-3" or "2.0.0-beta-1".

      Also in other cases 2.0.0 should be before 2.0.0-patch-XXXX and 2.0.0.1. Also 2.0 should be before 2.0.1.

      Can we expand the versions checked in TestVersionInfo to include a) some "same major different minor", b) "same minor different maintenance", c) both of the above, but SNAPSHOT, d) "-alpha" / "-beta"?

        Attachments

        1. HBASE-20444.addendum.0.patch
          3 kB
          Sean Busbey
        2. HBASE-20444.master.004.patch
          6 kB
          maoling
        3. HBASE-20444.master.003.patch
          6 kB
          maoling
        4. HBASE-20444.master.002.patch
          6 kB
          maoling
        5. HBASE-20444.master.001.patch
          6 kB
          maoling

          Activity

            People

            • Assignee:
              maoling maoling
              Reporter:
              uagashe Umesh Agashe
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: