History | View | Annotate | Download (6.9 kB)
Merge branch 'stable-0.2'
Change the balancing function
Currently the balancing function is a modified version of the standarddeviation (stddev divided by list length), due to historical reasons.
While this works fine for small clusters, for big clusters it makesthe balancing effect too "weak", and in some cases it refuses to...
Generalise the sepSplit function
Currently it works on splitting strings by individual chars, but wecan generalise it to split lists by list elements, which means we canreuse it later in the Text module for splitting both lists of chars by'|' or lists of lines by empty newlines. The change also makes the...
Add a type alias for UUIDs
This is to pottentially allow easier changes later.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Balazs Lecz <leczb@google.com>
Utils: add a default UUID
This will be used as a placeholder for the cases when we need a UUID(any UUID), but we don't have one handy.
Improve the standard deviation computation
This does just two passes, instead of three, over the list. This reducesthe overall runtime well enough (~25%) in some tests, but it's notreproducible using profiling, so I don't know how much the functionitself is being sped-up....
Add some more debugging functions
These are just variations of the standard debug, but are provided forsimpler code, since lazyness is something causing non-computation ofdebug statements.
Remove an obsolete function and add Utils tests
Introduce suport for optional keys in JObjects
Some keys are optional in the Ganeti opcodes (e.g. ‘node’ in theOpReplaceDisks), and as such we need to transform them in a Maybe value,instead of failing.
The patch reworks a bit fromObj and adds maybeFromObj which parses such...
Replace fromJResult with annotateJResult
This patch removes all old uses of fromJResult with the annotatedversion, and removes the non-annotated version. All JSON parsing pointsshould now have annotated errors.
Add annotations to loadJSArray
This allows, for example, the RAPI backend to detail which information(instance or node data) fails to parse.
Change fromObj error messages
Currently fromObj doesn't detail what we're trying to read, which canlead to cryptic messages: "Cannot read Int". The patch changes thisfunction to annotate the error messages with the key/value we're tryingto convert, by using a new version of fromJResult....
Fix unused imports for ghc 6.12
GHC 6.12 has become more picky about unused imports, so we need toremove/tighten some of them.
Collapse the statistical functions into one
This allows us to get rid of two duplicate list length computations,with a minor speedup.
Specialize the math functions
The statistics functions are currently defined as polymorphic with aFloating constraint. Changing this to monomorphic on Double type makesthem stricter and much more performant (~70% speedup). This is a cheapway to recoup some of the loses incurred by the recent proliferation of...
Enhance the error reporting for Rapi and Luxi
Currently the JSON conversion in Rapi and Luxi are giving somethinglike: Error: failed to load data. Details: Unable to read Double
This doesn't tell one where the error is (in a node specification? and...
Change the Utils.fromObj signature
Currently the fromObj function takes a JSON object which is thenconverted into a list of (String, JSValue) in which we make a lookup.However, most of the callers of this function call it repeatedly on thesame object, which means we do the object→list conversion repeatedly....
Generalise the node/instance listing
This patch introduces a generic formatTable function (based on, andsimilar to the Ganeti one, but different and more FP in style) andchanges the node and instance listing to it.
The node list (due to the many variables) is still a little bit hackish...
Move some utility functions to Utils.hs
These were already duplicate (Text and Simu) and we need tryRead in more places.
Turn on, and fix, more warnings
The Makefile was intented to be -Wall and not simply -W, but I missedthat. This enables more warnings and also enables -Werror (except forthe tests).
Optimize the Utils.stdDev function
This patch optimizes the stdDev function in two respects: - first, we don't do sum . map which builds an intermediate list, but instead use a fold over the list to build incrementally the sum; this should reduce both the time and space characteristics, as we...
Fix hlint-generated warnings
This big patch cleans up the code per hlint indications. Many removalsof extra parentheses, replacements of concat . map with concabtMap,extra dollar signs, eta reductions, etc. were performed.
The code still compiles and passes a couple of manual tests on sample...
Fix 'unused X' warnings
This removes some unused functions and imports to cleanup the warnings.
Fix the various monomorphism warning
In a few places (e.g. tryRead or any printf call) it's a little bit hardto add the correct type signatures, but in the it is possible to fixthese warnings (which can bite one in subtle cases).
Add an utility function for triples
Add copyright/license information
This doc-patch adds copyright and license information to (hopefully) allneeded files.
Cleanup an old function
Also replace a type with its synonim.
Lots of documentation updates
This patch does only doc build changes, doc changes and function movearound (for more logical documentation). It should have no impact at allon the code.
More code reorganizations
This new big patch does a couple of more cleanups in the loading of datachapter: - introduce a Types module that holds most types (except the base Node/Instance/etc.) so that multiple other modules can use these (instead of only Cluster and its users)...
Initial work on hail
This makes hail compile and get a request parsed via IAlloc, but nothingmore.
Generalize some Result function into monad ones
We don't really needed, but is more clean like this.
Switch from hand-written monads to a real one
This big patch converts from our home-grown monad-like constructs(the Either stuff) to a real, Either-like-but-another-name monad.
We introduce a “Result a” monad, and this allows dropping many of theextra constructs. Hopefully the code is also more clear....
Add support for 'offline' nodes
This patch drops compatiblity with Ganeti 1.2 and adds support foroffline nodes in the cluster. When reading from RAPI, the drained nodesare considered offline so that we don't allocate on them too.
Update the IAlloc module
We know have a working parseData function that returns the node andinstance data. This uncovered bad support for non-drbd instances ☹
Move the JSON utilities to Utils.hs
This patch moves the generic/reusable JSON functions to Utils.hs, sothat they're shared between RAPI/IAlloc.
hbal: Abort for invalid offline node names
Since it's easy to pass a wrong node name as offline, we should abortinstead of silently ignoring it.
Split common CLI functionality into a module
This patch moves the common CLI functionality (as much as currentlypossible) into a separate module. This means we only have one parseOptsand that Utils.hs doesn't keep this kind of functions anymore.
Introduce a namespace for the modules
The modules are moved from the ‘top’ namespace to ‘Ganeti.HTools’, incompliance with standard practices.