Comment 1 for bug 1308407

Revision history for this message
Derek Higgins (derekh) wrote :

I've reproduced this locally, it only happens when we are bumping up against max-servers (or presumably the quota).

There is code in nodepool to allocated nodes based on the ratio they were configured for but this doesn't happen correctly when there is demand for more then one server type and only one allocation is available.

In this scenario as nodes become available (1 at a time), and there is demand for more then one type, each new allocation is given to the first node type in the list (which is our case is the precise nodes), the only way we get a new f20 node created is if more then one allocation is freed at the same time, only then does nodepool move to the second node in the list.

I'm thinking a weighted randomiser to randomise the list but favouring requests based on their demand would be a more favourable algorithm.

This would replace the sort that is currently in the code
class AllocationProvider(object):
    def makeGrants(self):
        reqs.sort(lambda a, b: cmp(a.getPriority(), b.getPriority()))