On Mon, Oct 19, 2015 at 08:50:19PM +0200, Oleg Ponomarev wrote:
> Also fix comment to the balanceTask function.
> 
> >+ maximum . (0.0:) . map (iPolicyMemoryRatio .Node.iPolicy)
> 
> And why 0.0 here? Why not 1.0?

The purpose of the (0.0:) is to comply with our style guide of
writing total functions only. Note that maximum is only defined,
if the input is non-empty; so to ensure totality that can easily
seen when reading the definition I have to provide an element so
that the list is obviously not empty.

However, in the intended use cases (Ganeti will never run on a
0-node cluster) the list isn't empty; so I want to take a value
that doesn't modify the outcome in this case, i.e., the smallest
possible value. While we only had oversubscription ratios of 1.0
and bigger in mind, the values between 0.0 and 1.0 are forseeable
abuse (I'm pretty sure someone will eventually have to idea to
donate 10% of the memory of its machine to a Ganeti test cluster,
while using the rest interactively). While we don't support these
abuses, it doesn't hurt to chose a value that works in this case as
well.

-- 
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Matthew Scott Sucherman, Paul Terence Manicle

Reply via email to