hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-13686) Fail to limit rate in RateLimiter
Date Sun, 07 Jun 2015 19:31:01 GMT

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

Hudson commented on HBASE-13686:
--------------------------------

FAILURE: Integrated in HBase-1.1 #528 (See [https://builds.apache.org/job/HBase-1.1/528/])
HBASE-13686 - Fail to limit rate in RateLimiter (Ashish Singhi) (ramkrishna: rev 69ec2f4eed88a447230bac98c48567c3caf941d0)
* hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/AverageIntervalRateLimiter.java
* hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestRateLimiter.java
* hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/ThrottlingException.java
* hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/TimeBasedLimiter.java
* hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FixedIntervalRateLimiter.java
* hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RateLimiter.java


> Fail to limit rate in RateLimiter
> ---------------------------------
>
>                 Key: HBASE-13686
>                 URL: https://issues.apache.org/jira/browse/HBASE-13686
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 2.0.0, 1.1.0
>            Reporter: Guanghao Zhang
>            Assignee: Ashish Singhi
>              Labels: multitenancy, quota
>             Fix For: 2.0.0, 1.2.0, 1.1.1
>
>         Attachments: HBASE-13686-branch-1.patch, HBASE-13686-v1.patch, HBASE-13686-v2.patch,
HBASE-13686.patch
>
>
> While using the patch in HBASE-11598 , I found that RateLimiter can't to limit the rate
right.
> {code} 
>  /**
>    * given the time interval, are there enough available resources to allow execution?
>    * @param now the current timestamp
>    * @param lastTs the timestamp of the last update
>    * @param amount the number of required resources
>    * @return true if there are enough available resources, otherwise false
>    */
>   public synchronized boolean canExecute(final long now, final long lastTs, final long
amount) {
>     return avail >= amount ? true : refill(now, lastTs) >= amount;
>   }
> {code}
> When avail >= amount, avail can't be refill. But in the next time to call canExecute,
lastTs maybe update. So avail will waste some time to refill. Even we use smaller rate than
the limit, the canExecute will return false. 



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

Mime
View raw message