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

Overflow in ServerName's compareTo method

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 1.1.6, 0.98.21, 1.2.3, 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Looking at the ServerName's compareTo(),

      https://github.com/apache/hbase/blob/master/hbase-common/src/main/java/org/apache/hadoop/hbase/ServerName.java#L303

      It converts the return int value by converting long to int like (int)(longValue), which could be incorrect when it overflows, need to replace it with Long.compareTo(a,b).

      Matteo Bertozzi found some others as well, such as
      https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java#L990

        Attachments

        1. HBASE-16272-0.98-addendum.patch
          0.9 kB
          Andrew Kyle Purtell
        2. HBASE-16272-0.98.patch
          8 kB
          Andrew Kyle Purtell
        3. HBASE-16272-v001.patch
          6 kB
          Hua Xiang

          Issue Links

            Activity

              People

              • Assignee:
                huaxiang Hua Xiang
                Reporter:
                huaxiang Hua Xiang
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: