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

Josh Elser commented on HBASE-20588:
------------------------------------

{quote}Isn't this because removal of quota from a table would remove entries 
for that table from {{hbase:quota}}.
{quote}
Ah, I missed setting the quota to NONE in the steps that Biju listed. Thanks 
for the explanation – your fix makes sense to me now.
{code:java}
+        if (!newSnapshots.containsKey(tableName)) {
+          if (LOG.isTraceEnabled()) {
+            LOG.trace("Removing quota violation policy on " + tableName);
+          }
+          getManager().disableViolationPolicyEnforcement(tableName);
+        }{code}
I am wondering if, when iterating over {{currentSnapshots}}, should we be 
checking to see if that {{SpaceQuotaSnapshot}} was in violation instead of 
blindly calling {{disableViolationPolicyEnforcement}}? The implementation of 
{{disableViolationPolicyEnforcement}} handles this scenario just fine and this 
should be a "rare" event, so it's probably not a big deal that we call it.
{code:java}
+  private void removeQuotaFromtable(final TableName tn) throws IOException, 
InterruptedException {
+    QuotaSettings removeQuota = QuotaSettingsFactory.removeTableSpaceLimit(tn);
+    TEST_UTIL.getAdmin().setQuota(removeQuota);
+    LOG.info("Space quota settings removed from the table");
+    Thread.sleep(5000);
+  }{code}
This static sleep is a no-go. Please copy the approach from {{verifyViolation}} 
and change the implementation of {{assertPutDoesNotViolateQuota}} retry a 
number of times before failing the test.

Nice unit test additions overall, [~nihaljain.cs]! I think I convinced myself 
that the first comment on {{disableViolationPolicyEnforcement}} can be ignored, 
but we should get the second comment fixed. After that, I'm +1 on QA.

> Space quota change after quota violation doesn't seem to take in effect
> -----------------------------------------------------------------------
>
>                 Key: HBASE-20588
>                 URL: https://issues.apache.org/jira/browse/HBASE-20588
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 3.0.0, 2.0.0
>            Reporter: Biju Nair
>            Assignee: Nihal Jain
>            Priority: Major
>             Fix For: 3.0.0
>
>         Attachments: HBASE-20588.master.001.patch, 
> HBASE-20588.master.001.patch, HBASE-20588.master.002.patch
>
>
> Steps followed 
>  - Through {{hbase shell}}
> {noformat}
> set_quota TYPE => SPACE, TABLE => 'TestTable', LIMIT => '2M', POLICY => 
> NO_INSERTS{noformat}
>  - Run {{PE}} until the quota is reached
> {noformat}
> hbase org.apache.hadoop.hbase.PerformanceEvaluation --nomapred 
> --rows=20000000 sequentialWrite 1{noformat}
>  - Through {{HBase}} shell
> {noformat}
> set_quota TYPE => SPACE, TABLE => 'TestTable', LIMIT => NONE{noformat}
> - Through {{HBase}} shell verify the effective Quotas
> {noformat}
> > list_quotas
> OWNER                                               QUOTAS                    
>                                                                               
>                                              
> 0 row(s)
> Took 0.0365 seconds{noformat}
>  - Wait for some time (at least 5 mins) and try to add data to the table
> {noformat}
> > put 'TestTable','r1','info0:0','v1'
> ERROR: org.apache.hadoop.hbase.quotas.SpaceLimitingException: NO_INSERTS Puts 
> are disallowed due to a space quota.
> at 
> org.apache.hadoop.hbase.quotas.policies.NoInsertsViolationPolicyEnforcement.check(NoInsertsViolationPolicyEnforcement.java:47){noformat}
> To resolve the issue, {{RSes}} need to be restarted which points to in memory 
> data not getting reset. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to