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

Filters are not properly applied in certain cases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.94.1
    • 0.94.2
    • None
    • None

    Description

      Steps to reproduce:

      Create a table, load data into it. Flush the table.

      Do a scan with
      1. Some filter which should not match the first entry in the scan
      2. Where one specifies a family and column.
      You will notice that the first entry is returned even though it doesn't match the filter.

      It looks like the when the first KeyValue of a scan in the column from the point of view of the code

      HRegion.java

      } else if (kv != null && !kv.isInternal() && filterRowKey(currentRow)) {
      

      Is generated by

      public static KeyValue createLastOnRow(final byte [] row,
      final int roffset, final int rlength, final byte [] family,
      final int foffset, final int flength, final byte [] qualifier,
      final int qoffset, final int qlength) { return new KeyValue(row, roffset, rlength, family, foffset, flength, qualifier, qoffset, qlength, HConstants.OLDEST_TIMESTAMP, Type.Minimum, null, 0, 0); }
      

      So it is always internal from that point of the code.

      Only later from within
      StoreScanner.java

      public synchronized boolean next(List<KeyValue> outResult, int limit, String metric) throws IOException {
      ....
      LOOP: while((kv = this.heap.peek()) != null) {
      

      ( The second time through)

      Do we get the actual kv, with a proper type and timestamp. This seems to mess with filtering.

      Attachments

        1. minimalTest.java
          2 kB
          Alex Newman
        2. 6912-0.96.txt
          6 kB
          Lars Hofhansl
        3. 6912-0.94.txt
          6 kB
          Lars Hofhansl

        Issue Links

          Activity

            People

              larsh Lars Hofhansl
              posix4e Alex Newman
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: