You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "ChiaPing Tsai (JIRA)" <ji...@apache.org> on 2016/06/26 18:32:52 UTC

[jira] [Comment Edited] (HBASE-16071) The VisibilityLabelFilter and AccessControlFilter should not count the "delete cell"

    [ https://issues.apache.org/jira/browse/HBASE-16071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15350195#comment-15350195 ] 

ChiaPing Tsai edited comment on HBASE-16071 at 6/26/16 6:32 PM:
----------------------------------------------------------------

  all cells (delete tx => delete specified timestamp)
-------------
| delete t2 |
-------------
| delete t1 |
-------------
|  put t2   |
-------------
|  put t1   |
-------------
|  put t0   |
-------------

case 1 : (raw scan) + (scan max version=2)
cells we get back:4
-------------
| delete t2 |
-------------
| delete t1 |
-------------
|  put t2   |
-------------
|  put t1   |
-------------

case 2 : (normal scan) + (scan max version=2)
cells we get back:1
-------------
|  put t0   |
-------------




was (Author: chia7712):
  all cells (delete tx => delete specified timestamp)
-------------  |
| delete t2 |  |
-------------  |
| delete t1 |  |
-------------  |
|  put t2   |  |
-------------  |
|  put t1   |  |
-------------  |
|  put t0   |  ▼
------------- order

case 1 : (raw scan) + (scan max version=2)
cells we get back:4
-------------
| delete t2 |
-------------
| delete t1 |
-------------
|  put t2   |
-------------
|  put t1   |
-------------

case 2 : (normal scan) + (scan max version=2)
cells we get back:1
-------------
|  put t0   |
-------------



> The VisibilityLabelFilter and AccessControlFilter should not count the "delete cell"
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-16071
>                 URL: https://issues.apache.org/jira/browse/HBASE-16071
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: ChiaPing Tsai
>            Assignee: ChiaPing Tsai
>            Priority: Minor
>             Fix For: 2.0.0, 1.3.0, 1.4.0
>
>         Attachments: HBASE-16071-v1.patch, HBASE-16071-v2.patch, HBASE-16071-v3.patch
>
>
> 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:
> {code:title=VisibilityLabelFilter.java|borderStyle=solid}
>   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;
>   }
> {code}
> [VisibilityLabelFilter.java|https://github.com/apache/hbase/blob/d7a4499dfc8b3936a0eca867589fc2b23b597866/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityLabelFilter.java]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)