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

Nihal Jain commented on HBASE-20588:
------------------------------------

[~elserj] I will raise a new issue, after submitting a patch for this one today.
{quote}When we drop a table, upon completion the quota triggers removal of 
disable policy, thus causing the system to enable the table
{quote}
I think I know the fix for this. The problem is in 
DisableTableViolationPolicyEnforcement. Look at the below two methods:
{code:java}
@Override
public void enable() throws IOException {
try {
if (LOG.isTraceEnabled()) {
LOG.trace("Starting disable of " + getTableName());
}
getRegionServerServices().getClusterConnection().getAdmin().disableTable(getTableName());
if (LOG.isTraceEnabled()) {
LOG.trace("Disable is complete for " + getTableName());
}
} catch (TableNotEnabledException tnee) {
// The state we wanted it to be in.
}
}

@Override
public void disable() throws IOException {
try {
if (LOG.isTraceEnabled()) {
LOG.trace("Starting enable of " + getTableName());
}
getRegionServerServices().getClusterConnection().getAdmin().enableTable(getTableName());
if (LOG.isTraceEnabled()) {
LOG.trace("Enable is complete for " + getTableName());
}
} catch (TableNotDisabledException tnde) {
// The state we wanted it to be in
}
}
{code}
 
We should not only catch TableNotEnabledException/TableNotDisabledException but 
also catch TableNotFoundException. This would solve the above issue. Also it 
will ensure that space quota design is consistent across all other policies 
i.e. all other policies allow enforcement of quota on a non-existant table. But 
from above code it is impossible to achieve this for DISABLE policy. What do 
you think about my thoughts?

> 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