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

Sakthi commented on HBASE-21892:
--------------------------------

Ah! This is a nice catch. So this is actually an expected behavior. Here is 
what's happening:
 * Namespace quota set & violated. (with 'nfs1' table usage at 12 mb vs the set 
quota of 10 mb)
 * A new table 'nfs2' is created. (so by default 1 region initially if no split 
keys). Let's assume this was just a simple create command rather than using PE 
again.
 * The quotaobserverchore at master side lists out this new table under 
potential list of tables for the set namespace quota
 * But then because it hasn't yet received usagereport from rs about the only 
region/ or threshold amount of regions of this table, hence filters it out from 
considerationand continues to stop writes from nfs1 as the quota is violated. 
But nfs2 is not observed under quota and hence a put/flush command meanwhile 
would work fine.
 * This can go on, until the RS sends in it's first report and the table is not 
filtered out at master side and the quota violation for nfs2 table is persisted 
to the quota table. 
 * Even then, till spacerefresherchore from the rs side runs and detects this 
table being in the list of violated tables from hbase:quota, the puts etc can 
still carry on.
 * And finally, when it is detected by that chore, the appropriate policy is 
enforced.

 

[~elserj], please correct me if I am wrong. 

But I think it's worthwhile to discuss if we should allow '*create*' of a table 
when we know that it's for a namespace which is already under violation, and if 
continue to allow creation anyway then I don't there is any way to completely 
stop the writes etc till the above mention steps are completed. We can at best 
try to better the notification mechanism but still it would not be as 
spontaneous as expected. Josh, what do you think? :) 

> If a new table is created inside a namespace then Namespace space quota 
> violation is not working for first time
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-21892
>                 URL: https://issues.apache.org/jira/browse/HBASE-21892
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Ajeet Rai
>            Assignee: Sakthi
>            Priority: Minor
>              Labels: Quota, Space
>
> If a new table is created inside a namespace then NS quota violation is not 
> working for first time.
> Steps to reproduce:
> 1: Set a space quota at NameSpace level
> set_quota TYPE => SPACE, NAMESPACE => 'game', LIMIT => '10M', POLICY => 
> NO_WRITES
> 2: create a table and add insert data such that NS quota is violated
>  create_namespace 'game'
> ./hbase pe --table="game:nfs" --nomapred --rows=1200  sequentialWrite  10
> 3: Try to load data in table again and observe that quota is applicable
> 4: Now create another table under same NS and put some data
> ./hbase pe --table="game:nfs2" --nomapred --rows=120  sequentialWrite  10
> 5: Observe that data is inserted in new table which should not happen due to 
> namespace quota is already violated



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to