HBase
  1. HBase
  2. HBASE-10826

PrefixTree seekTo does not seek to the correct key if the given key is not in the existing kvs

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Invalid
    • Affects Version/s: 0.98.0, 0.99.0, 0.96.1.1
    • Fix Version/s: None
    • Component/s: Scanners
    • Labels:

      Description

          KeyValue kv1 = new KeyValue(Bytes.toBytes("aaa"), Bytes.toBytes("fam1"), Bytes.toBytes("q1"),
              Bytes.toBytes("val"));
          writer.append(kv1);
          KeyValue kv2 = new KeyValue(Bytes.toBytes("aab"), Bytes.toBytes("fam1"), Bytes.toBytes("q1"),
              Bytes.toBytes("val"));
          writer.append(kv2);
          KeyValue kv4 = new KeyValue(Bytes.toBytes("aac"), Bytes.toBytes("fam1"), Bytes.toBytes("q1"),
              Bytes.toBytes("val"));
          writer.append(kv4);
          KeyValue kv5 = new KeyValue(Bytes.toBytes("aac"), Bytes.toBytes("fam12"), Bytes.toBytes("q2"),
              Bytes.toBytes("val"));
      writer.append(kv5);
      
          KeyValue toSeek = new KeyValue(Bytes.toBytes("aac"), Bytes.toBytes("fam1"),
              Bytes.toBytes("q2"), Bytes.toBytes("val"));
          StoreFileScanner s = reader.getStoreFileScanner(false, false);
          s.reseek(toSeek);
      

      Now calling s.next() should point to the last KV - kv5.
      Before calling s.next() it would have done a moveToPrevious since there is no KV that exactly matches with the toSeek key.
      Incase of NONE, PREFIX, DIFF, FAST_DIFF things work fine as expected.
      But in case of Prefix Tree, calling reseek() points to a key that is same as the toSeek key which does not exist at all.
      Will attach a testcase that shows this problem.

        Activity

        Hide
        ramkrishna.s.vasudevan added a comment -

        This issue is not applicable here because Prefix Tree would expect the same family at this layer. As we are directly testing the buffer and the seeker here it does not make sense to change the family.

        Show
        ramkrishna.s.vasudevan added a comment - This issue is not applicable here because Prefix Tree would expect the same family at this layer. As we are directly testing the buffer and the seeker here it does not make sense to change the family.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development