Hi folks, I have three questions about the ZK outstanding requests metric.
*Q1. *In the ZooKeeperServer.java, we report the number of outstanding requests by the below method: /** * return the outstanding requests * in the queue, which haven't been * processed yet */ public long getOutstandingRequests() { return getInProcess(); } However, based on my understanding, the *getInProcess()* method returns the number of requests in the process pipeline (*requestsInProcess*) since we increase the value of requestsInProcess after the request enters the PreRequestProcessor and decrease the value of requestsInProcess after the request in the FinalRequestProcess. Since we have already maintained the *outstandingCount* in ServerCnxn.java, shouldn't we call the getOutstandingRequests() method to report the number of outstanding requests? *Q2.* In the below *shouldThrottle* 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*). public boolean shouldThrottle(long outStandingCount) { int globalOutstandingLimit = getGlobalOutstandingLimit(); if (globalOutstandingLimit < getInflight() || globalOutstandingLimit < getInProcess()) { return outStandingCount > 0; } return false; } *Q3.* When we calculate the *outstandinglimit*, why do we divide the limit with <quorum size minus one> instead of <quorum size> directly? int divisor = self.getQuorumSize() > 2 ? self.getQuorumSize() - 1 : 1; int globalOutstandingLimit = super.getGlobalOutstandingLimit() / divisor Thank you for your time! Regards, Zhewei