[jira] [Commented] (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=16815615#comment-16815615 ] Andrew Purtell commented on HBASE-16071: Any progress here? Or unschedule it? Or close it? > 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: Chia-Ping Tsai >Assignee: Chia-Ping Tsai >Priority: Minor > Fix For: 3.0.0, 1.5.0, 2.3.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 (v7.6.3#76005)
[jira] [Commented] (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=15957365#comment-15957365 ] Hadoop QA commented on HBASE-16071: --- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 0s {color} | {color:blue} Docker mode activated. {color} | | {color:red}-1{color} | {color:red} patch {color} | {color:red} 0m 4s {color} | {color:red} HBASE-16071 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/0.3.0/precommit-patchnames for help. {color} | \\ \\ || Subsystem || Report/Notes || | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12813468/HBASE-16071-v3.patch | | JIRA Issue | HBASE-16071 | | Console output | https://builds.apache.org/job/PreCommit-HBASE-Build/6327/console | | Powered by | Apache Yetus 0.3.0 http://yetus.apache.org | This message was automatically generated. > 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: Chia-Ping Tsai >Assignee: Chia-Ping Tsai >Priority: Minor > Fix For: 2.0.0, 1.4.0, 1.3.2 > > 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.15#6346)
[jira] [Commented] (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=15607878#comment-15607878 ] ChiaPing Tsai commented on HBASE-16071: --- {quote} May be we need to consider version = Math.min(requestedMaxVersion , hcd.getMaxVersions()); {quote} The AccessControlFilter's max version should be equal with ScanWildcardColumnTracker’s max version. I mean doing this {noformat} int maxVersions = scan.isRaw() ? scan.getMaxVersions() : Math.min(scan.getMaxVersions(), scanInfo.getMaxVersions()); {noformat} If AccessControlFilter's max version is bigger than ScanWildcardColumnTracker’s max version, AccessControlFilter will authorize the unnecessary cell. Because the Filter#filterKeyValue(cell) is getting called before calling ColumnTracker#checkVersions. {code:title=UserScanQueryMatcher.java|borderStyle=solid} ReturnCode filterResponse = ReturnCode.SKIP; // STEP 2: Yes, the column is part of the requested columns. Check if filter is present if (filter != null) { // STEP 3: Filter the key value and return if it filters out filterResponse = filter.filterKeyValue(cell); switch (filterResponse) { case SKIP: return MatchCode.SKIP; case NEXT_COL: return columns.getNextRowOrNextColumn(cell); case NEXT_ROW: stickyNextRow = true; return MatchCode.SEEK_NEXT_ROW; case SEEK_NEXT_USING_HINT: return MatchCode.SEEK_NEXT_USING_HINT; default: // It means it is either include or include and seek next break; } } colChecker = columns.checkVersions(cell, timestamp, typeByte, false); {code} If AccessControlFilter's max version is smaller than ScanWildcardColumnTracker’s max version, AccessControlFilter will loss some cells. bq. But Filter#filterCell is getting called before applying deleted logic, expiry logic etc. (If the Filter#filterCell is the Filter#filterKeyValue) The RawScanQueryMatcher#match(cell) is shown below. {code:title=RawScanQueryMatcher.java|borderStyle=solid} @Override public MatchCode match(Cell cell) throws IOException { if (filter != null && filter.filterAllRemaining()) { return MatchCode.DONE_SCAN; } MatchCode returnCode = preCheck(cell); if (returnCode != null) { return returnCode; } // For a raw scan, we do not filter out any cells by delete marker, and delete marker is also // returned, so we do not need to track delete. return matchColumn(cell); } {code} The expiry logic is implemented in ScanQueryMatcher#preCheck. So Filter#filterKeyValue is getting called “after” applying expiry logic. And the RawScanQueryMatcher doesn’t apply any deleted logic. So it seems to me that the deleted logic and expiry logic are not problem. Sorry if I made any mistake, and thanks for your feedback. > 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.4.0, 1.3.1 > > 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 >
[jira] [Commented] (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=15601656#comment-15601656 ] Anoop Sam John commented on HBASE-16071: Sorry for being late. This is a good find. bq.int maxVersions = isRaw ? requestedMaxVersion : hcd.getMaxVersions(); Only for raw scan we need consider max versions specified in Get/Scan? May be we need to consider max versions in Get/Scan always? May be we need to consider version = Math.min(requestedMaxVersion , hcd.getMaxVersions()); Good that we do not count delete marker cells now.. But what abt deleted cells? And TTL expired cells. Ideally we should not be counting those. But Filter#filterCell is getting called before applying deleted logic, expiry logic etc. We should be doing this filtering of cell via Filter#filterRowCells(List kvs)? > 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.4.0, 1.3.1 > > 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)
[jira] [Commented] (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=15593911#comment-15593911 ] Hadoop QA commented on HBASE-16071: --- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 14s {color} | {color:blue} Docker mode activated. {color} | | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s {color} | {color:green} The patch does not contain any @author tags. {color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s {color} | {color:green} The patch appears to include 2 new or modified test files. {color} | | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 3m 17s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 34s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 44s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 14s {color} | {color:green} master passed {color} | | {color:red}-1{color} | {color:red} findbugs {color} | {color:red} 1m 40s {color} | {color:red} hbase-server in master has 1 extant Findbugs warnings. {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 25s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 44s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 33s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 33s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 43s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 13s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s {color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} hadoopcheck {color} | {color:green} 31m 29s {color} | {color:green} Patch does not cause any errors with Hadoop 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.6.1 2.6.2 2.6.3 2.7.1 or 3.0.0-alpha1. {color} | | {color:green}+1{color} | {color:green} hbaseprotoc {color} | {color:green} 0m 12s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 47s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 25s {color} | {color:green} the patch passed {color} | | {color:red}-1{color} | {color:red} unit {color} | {color:red} 87m 0s {color} | {color:red} hbase-server in the patch failed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 16s {color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 130m 52s {color} | {color:black} {color} | \\ \\ || Reason || Tests || | Timed out junit tests | org.apache.hadoop.hbase.client.TestReplicaWithCluster | | | org.apache.hadoop.hbase.client.TestHCM | | | org.apache.hadoop.hbase.client.TestMobCloneSnapshotFromClient | \\ \\ || Subsystem || Report/Notes || | Docker | Client=1.11.2 Server=1.11.2 Image:yetus/hbase:7bda515 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12813468/HBASE-16071-v3.patch | | JIRA Issue | HBASE-16071 | | Optional Tests | asflicense javac javadoc unit findbugs hadoopcheck hbaseanti checkstyle compile | | uname | Linux 51fbe7c2a388 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /home/jenkins/jenkins-slave/workspace/PreCommit-HBASE-Build/component/dev-support/hbase-personality.sh | | git revision | master / d3decaa | | Default Java | 1.8.0_101 | | findbugs | v3.0.0 | | findbugs | https://builds.apache.org/job/PreCommit-HBASE-Build/4130/artifact/patchprocess/branch-findbugs-hbase-server-warnings.html | | unit | https://builds.apache.org/job/PreCommit-HBASE-Build/4130/artifact/patchprocess/patch-unit-hbase-server.txt | | unit test logs | https://builds.apache.org/job/PreCommit-HBASE-Build/4130/artifact/patchprocess/patch-unit-hbase-server.txt | | Test Results | https://builds.apache.org/job/PreCommit-HBASE-Build/4130/testReport/ | | modules | C: hbase-server U: hbase-server | | Console output |
[jira] [Commented] (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=15367935#comment-15367935 ] ChiaPing Tsai commented on HBASE-16071: --- hi [~anoop.hbase] Please let me know if this patch is suitable. thanks > 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)
[jira] [Commented] (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=15361631#comment-15361631 ] ChiaPing Tsai commented on HBASE-16071: --- any comment ? thanks > 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)
[jira] [Commented] (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=15350195#comment-15350195 ] ChiaPing Tsai commented on HBASE-16071: --- 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)
[jira] [Commented] (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=15350180#comment-15350180 ] Anoop Sam John commented on HBASE-16071: When Scan is set with rawScan and we have 2 versions deleted and another non deleted version. So there are total 5 cells (2 DELETE type and 3 PUT type) out of which only one is undeleted. How many cells we get back? (In normal scan case- no vis labels).Say scan maxVersions set to 2. > 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)
[jira] [Commented] (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=15350141#comment-15350141 ] Hadoop QA commented on HBASE-16071: --- | (/) *{color:green}+1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:green}+1{color} | {color:green} hbaseanti {color} | {color:green} 0m 0s {color} | {color:green} Patch does not have any anti-patterns. {color} | | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s {color} | {color:green} The patch does not contain any @author tags. {color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s {color} | {color:green} The patch appears to include 2 new or modified test files. {color} | | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 2m 54s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 44s {color} | {color:green} master passed with JDK v1.8.0 {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 34s {color} | {color:green} master passed with JDK v1.7.0_80 {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 53s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 15s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 56s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 27s {color} | {color:green} master passed with JDK v1.8.0 {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 33s {color} | {color:green} master passed with JDK v1.7.0_80 {color} | | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 44s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 43s {color} | {color:green} the patch passed with JDK v1.8.0 {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 43s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 33s {color} | {color:green} the patch passed with JDK v1.7.0_80 {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 33s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 54s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 15s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s {color} | {color:green} Patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} hadoopcheck {color} | {color:green} 25m 56s {color} | {color:green} Patch does not cause any errors with Hadoop 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.6.1 2.6.2 2.6.3 2.7.1. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 2m 8s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 27s {color} | {color:green} the patch passed with JDK v1.8.0 {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 32s {color} | {color:green} the patch passed with JDK v1.7.0_80 {color} | | {color:green}+1{color} | {color:green} unit {color} | {color:green} 90m 38s {color} | {color:green} hbase-server in the patch passed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 17s {color} | {color:green} Patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 131m 45s {color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12813468/HBASE-16071-v3.patch | | JIRA Issue | HBASE-16071 | | Optional Tests | asflicense javac javadoc unit findbugs hadoopcheck hbaseanti checkstyle compile | | uname | Linux asf907.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /home/jenkins/jenkins-slave/workspace/PreCommit-HBASE-Build/component/dev-support/hbase-personality.sh | | git revision | master / fc4b8aa | | Default Java | 1.7.0_80 | | Multi-JDK versions | /home/jenkins/tools/java/jdk1.8.0:1.8.0 /home/jenkins/jenkins-slave/tools/hudson.model.JDK/JDK_1.7_latest_:1.7.0_80 | | findbugs | v3.0.0 | | Test Results |
[jira] [Commented] (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=15349845#comment-15349845 ] Hadoop QA commented on HBASE-16071: --- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:green}+1{color} | {color:green} hbaseanti {color} | {color:green} 0m 0s {color} | {color:green} Patch does not have any anti-patterns. {color} | | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s {color} | {color:green} The patch does not contain any @author tags. {color} | | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s {color} | {color:green} The patch appears to include 2 new or modified test files. {color} | | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 2m 51s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 39s {color} | {color:green} master passed with JDK v1.8.0 {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 34s {color} | {color:green} master passed with JDK v1.7.0_80 {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 52s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 16s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 55s {color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 27s {color} | {color:green} master passed with JDK v1.8.0 {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 32s {color} | {color:green} master passed with JDK v1.7.0_80 {color} | | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 44s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 36s {color} | {color:green} the patch passed with JDK v1.8.0 {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 36s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 33s {color} | {color:green} the patch passed with JDK v1.7.0_80 {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 33s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 53s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 15s {color} | {color:green} the patch passed {color} | | {color:red}-1{color} | {color:red} whitespace {color} | {color:red} 0m 0s {color} | {color:red} The patch has 7 line(s) that end in whitespace. Use git apply --whitespace=fix. {color} | | {color:green}+1{color} | {color:green} hadoopcheck {color} | {color:green} 26m 2s {color} | {color:green} Patch does not cause any errors with Hadoop 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.6.1 2.6.2 2.6.3 2.7.1. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 2m 9s {color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 27s {color} | {color:green} the patch passed with JDK v1.8.0 {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 34s {color} | {color:green} the patch passed with JDK v1.7.0_80 {color} | | {color:red}-1{color} | {color:red} unit {color} | {color:red} 95m 13s {color} | {color:red} hbase-server in the patch failed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 16s {color} | {color:green} Patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 136m 12s {color} | {color:black} {color} | \\ \\ || Reason || Tests || | Failed junit tests | hadoop.hbase.snapshot.TestFlushSnapshotFromClient | | | hadoop.hbase.client.TestHCM | | | hadoop.hbase.snapshot.TestMobFlushSnapshotFromClient | \\ \\ || Subsystem || Report/Notes || | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12813394/HBASE-16071-v2.patch | | JIRA Issue | HBASE-16071 | | Optional Tests | asflicense javac javadoc unit findbugs hadoopcheck hbaseanti checkstyle compile | | uname | Linux asf907.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /home/jenkins/jenkins-slave/workspace/PreCommit-HBASE-Build/component/dev-support/hbase-personality.sh | | git revision | master / fc4b8aa | | Default Java | 1.7.0_80 | | Multi-JDK versions
[jira] [Commented] (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=15349766#comment-15349766 ] ChiaPing Tsai commented on HBASE-16071: --- I create a separate JIRA [HBASE-16113|https://issues.apache.org/jira/browse/HBASE-16113] > 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 > > > 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)
[jira] [Commented] (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=15349732#comment-15349732 ] ChiaPing Tsai commented on HBASE-16071: --- I got an non-empty result from the raw scan which has the "zero" value of the max version. The cells are shown below: --- | delete t1 | --- | put t1 | --- Is it a correct result ? The critical code is shown below: {code:title=ScanWildcardColumnTracker.java|borderStyle=solid} // May be we should check the verion first private MatchCode checkVersion(byte type, long timestamp) { if (!CellUtil.isDelete(type)) { currentCount++; } if (currentCount > maxVersions) { return ScanQueryMatcher.MatchCode.SEEK_NEXT_COL; // skip to next col } // keep the KV if required by minversions or it is not expired, yet if (currentCount <= minVersions || !isExpired(timestamp)) { setTSAndType(timestamp, type); return ScanQueryMatcher.MatchCode.INCLUDE; } else { return MatchCode.SEEK_NEXT_COL; } } {code} > 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 > > > 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)
[jira] [Commented] (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=15348050#comment-15348050 ] Anoop Sam John commented on HBASE-16071: In case of raw scan, the version counting can not happen at all.. > 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 > > > 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)
[jira] [Commented] (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=15347870#comment-15347870 ] ChiaPing Tsai commented on HBASE-16071: --- There is another bug. The ScanQueryMatcher will use the Scan#getMaxVersions for the raw scan. On the other hand, the VisibilityLabelFilter and AccessControlFilter still use the HColumnDescriptor#getMaxVersions that will cause all the oldder version be skipped if the raw scan with the larger version than column. > 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 > > > 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)