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

CellComparator.compareStatic() compares type wrongly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 0.98.1, 0.99.0, 0.96.1.1
    • Fix Version/s: 0.96.2, 0.98.1, 0.99.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      CellComparator.compareStatic(Cell a, Cell b) compares type wrongly.

          //type
          c = (0xff & a.getTypeByte()) - (0xff & b.getTypeByte());
          if (c != 0) return c;
      

      In the normal case it should be the other way

            // Compare types. Let the delete types sort ahead of puts; i.e. types
            // of higher numbers sort before those of lesser numbers. Maximum (255)
            // appears ahead of everything, and minimum (0) appears after
            // everything.
            return (0xff & rtype) - (0xff & ltype);
      

      Found this issue while replacing KVComparator to use CellComparator.
      Matt Corgan
      Could you confirm this once? Currently PrefixTree code path uses this compareStatic method.

        Attachments

        1. HBASE-10749.patch
          0.6 kB
          ramkrishna.s.vasudevan

          Activity

            People

            • Assignee:
              ram_krish ramkrishna.s.vasudevan
              Reporter:
              ram_krish ramkrishna.s.vasudevan
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: