[
https://issues.apache.org/jira/browse/ZOOKEEPER-3793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17433355#comment-17433355
]
Zhewei Hu commented on ZOOKEEPER-3793:
--------------------------------------
Hi [~hanm], I am trying to understand what does outstanding requests mean.
Q1. In the below code, why don't we compare the globalOutstandingLimit and
outStandingCount directly? Instead, we compare the outstanding limit with
requests that have not entered the processing pipeline (getInflight) and
requests in process (getInProcess).
{code:java}
public boolean shouldThrottle(long outStandingCount) {
int globalOutstandingLimit = getGlobalOutstandingLimit();
if (globalOutstandingLimit < getInflight() || globalOutstandingLimit <
getInProcess()) {
return outStandingCount > 0;
}
return false;
}
{code}
Q2. When we calculate the outstandinglimit, why we divide the limit with
<quorum size minus one> instead of <quorum size> directly?
{code:java}
int divisor = self.getQuorumSize() > 2 ? self.getQuorumSize() - 1 : 1;
int globalOutstandingLimit = super.getGlobalOutstandingLimit() / divisor
{code}
Thank you for your time!
> Request throttling is broken when RequestThrottler is disabled or configured
> incorrectly.
> -----------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-3793
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3793
> Project: ZooKeeper
> Issue Type: Bug
> Components: server
> Affects Versions: 3.6.0
> Reporter: Michael Han
> Assignee: Michael Han
> Priority: Critical
> Labels: pull-request-available
> Fix For: 3.7.0, 3.6.1
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> When RequestThrottler is not enabled or is enabled but configured
> incorrectly, ZooKeeper server will stop throttling. This is a serious bug as
> without request throttling, it's fairly easy to overwhelm ZooKeeper which
> leads to all sorts of issues.
> This is a regression introduced in ZOOKEEPER-3243, where the total number of
> queued requests in request processing pipeline is not taking into
> consideration when deciding whether to throttle or not, or only taken into
> consideration conditionally based on RequestThrottler's configurations. We
> should make sure always taking into account the number of queued requests in
> request processing pipeline before making throttling decisions.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)