HBASE-29912 Codel lifoThreshold should be applied on soft queue limit…#7864
HBASE-29912 Codel lifoThreshold should be applied on soft queue limit…#7864Umeshkumar9414 wants to merge 2 commits intoapache:masterfrom
Conversation
… instead of hard limit
|
|
||
| // so we can calculate actual threshold to switch to LIFO under load | ||
| private int maxCapacity; | ||
| private int currentQueueLimit; |
There was a problem hiding this comment.
Because this can be updated with onConfigurationChange should this be volatile ? Just a nit.
There was a problem hiding this comment.
This is also confusing in that it seems to shadow a variable of the same name that is declared volatile?
Please don't shadow. Why do we need this separately?
There was a problem hiding this comment.
I made currentQueueLimit volatile.
Please don't shadow. Why do we need this separately?
Generally a queue should only handle hard limit and layer above it can handle soft limit and that is what was happening but for codel, we needed queue to know the soft limit as well, I didn't saw a way to use the same variable at both place.
| // Multiple calls would incorrectly use the hard limit as the soft limit. | ||
| // As all the queues has same initArgs and queueClass, there should be no need to call this again. | ||
| protected void initializeQueues(final int numQueues) { | ||
| if (!queues.isEmpty()) { |
There was a problem hiding this comment.
Do we still need this guard?
There was a problem hiding this comment.
no we don't need it now.
| int numCalls = 48; | ||
| for (int i = 0; i < numCalls; i++) { | ||
| final int callId = i; | ||
| CallRunner call = createMockTask(HConstants.NORMAL_QOS); |
There was a problem hiding this comment.
Here and in two more cases createMockTask will mock a ServerCall without setting getReceiveTime(). It will default to 0. Doesn't this mess up the call delay calculation that coDel will do? It will be something like callDelay = System.currentTimeMillis() - 0 . I guess your tests are passing but CoDel will immediately detect overload. The LIFO switch counter will still increment but other aspects are probably wrong.
You should look at this.
… instead of hard limit