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

CellComparator.compareStatic() compares type wrongly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.98.1, 0.99.0, 0.96.1.1
    • 0.96.2, 0.98.1, 0.99.0
    • None
    • None
    • 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.
      mcorgan
      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

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

            Dates

              Created:
              Updated:
              Resolved: