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

The VisibilityLabelFilter and AccessControlFilter should not count the "delete cell"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Abandoned
    • 2.0.0
    • None
    • None
    • None

    Description

      The VisibilityLabelFilter will see and count the "delete cell" if the scan.isRaw() returns true, so the (put) cell will be skipped if it has lower version than "delete cell"

      The critical code is shown below:

      VisibilityLabelFilter.java
        public ReturnCode filterKeyValue(Cell cell) throws IOException {
          if (curFamily.getBytes() == null
              || !(CellUtil.matchingFamily(cell, curFamily.getBytes(), curFamily.getOffset(),
                  curFamily.getLength()))) {
            curFamily.set(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());
            // For this family, all the columns can have max of curFamilyMaxVersions versions. No need to
            // consider the older versions for visibility label check.
            // Ideally this should have been done at a lower layer by HBase (?)
            curFamilyMaxVersions = cfVsMaxVersions.get(curFamily);
            // Family is changed. Just unset curQualifier.
            curQualifier.unset();
          }
          if (curQualifier.getBytes() == null
              || !(CellUtil.matchingQualifier(cell, curQualifier.getBytes(), curQualifier.getOffset(),
                  curQualifier.getLength()))) {
            curQualifier.set(cell.getQualifierArray(), cell.getQualifierOffset(),
                cell.getQualifierLength());
            curQualMetVersions = 0;
          }
          curQualMetVersions++;
          if (curQualMetVersions > curFamilyMaxVersions) {
            return ReturnCode.SKIP;
          }
      
          return this.expEvaluator.evaluate(cell) ? ReturnCode.INCLUDE : ReturnCode.SKIP;
        }
      

      VisibilityLabelFilter.java

      Attachments

        1. HBASE-16071-v3.patch
          30 kB
          Chia-Ping Tsai
        2. HBASE-16071-v2.patch
          30 kB
          Chia-Ping Tsai
        3. HBASE-16071-v1.patch
          10 kB
          Chia-Ping Tsai

        Activity

          People

            Unassigned Unassigned
            chia7712 Chia-Ping Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: