- Dec 04, 2012
-
-
Iustin Pop authored
Since hlint doesn't check style issues but rather code only issues, let's add a simple Makefile check for too-long lines, and fix the single bad case we have currently. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Indentation within rules is fixed to always be 2 spaces (as opposed to mixed tabs/2 spaces/4 spaces). Additionally, the check-dirs rule, which was more complex than necessary, has been simplified: moved auto4mte.cache to DIRCHECK_EXCLUDE, and simplify the find call and the exit condition (no need for if test …; then exit 0; else exit 1; fi). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
The current uniqueness algorithm (generate random node names, suffix them with node index) is actually wrong: a node named "21" at index 5 will end up with the same name as a node named "2" at position 15. To fix this, we also add a character from a different "set" ("-"), so that such mixups can't happen again, and also add an explicit check for it. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
All resources are acquired and opportunistic instance creations would fail. Also add a TODO. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Opportunistic locks are not yet used. This patch changes LUInstanceCreate to acquire the node allocation lock to avoid conflicts with other opcodes acquiring many node locks. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
See code for an explanatory comment. The lock is released as soon as possible. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Dimitris Aragiorgis authored
LUNetworkConnect/Disconnect looks up a nodegroup's instances for conflicting IPs. To do so, use GetNodeGroupInstances() and GetMulitInstanceInfo(). Additionally, check if the correct locks were acquired. Signed-off-by:
Dimitris Aragiorgis <dimara@grnet.gr> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
The network management code needs to verify a MAC address prefix. Instead of (ab)using NormalizeAndValidateMac, clean code should be used. Unit tests for NormalizeAndValidateMac are updated and new ones for NormalizeAndValidateThreeOctetMacPrefix are added. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Dec 03, 2012
-
-
Michele Tartara authored
Instead of having two different lists of directories, now there is only one. Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
This code is going to be used by a new utility for setting up the node daemon. Unit tests are updated/added. Additionally, the certificate and key stored in “server.pem” are verified, too. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Similar to “share_locks”, a new dictionary containing booleans for each locking level is added to “cmdlib.LogicalUnit”. Logical units wanting to make use of opportunistic locks will be able to configure this dictionary accordingly. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Just forwarding the parameter, nothing more. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
This patch adds a new parameter to “LockSet.acquire” named “opportunistic”. When enabled the lockset will try to acquire as many locks as possible, but it won't wait for them (with the exception of the lockset-internal lock in case the whole set is acquired). This is implemented by using a timeout of 0 seconds when acquiring individual locks. Commit 03c5291c made such acquisitions significantly cheaper. The most complicated code included in this patch is probably the helper function used to determine which mode to use and which timeout functions are needed. Full unit tests are included for the new and changed code (“locking.py”'s overall coverage is at 97%). Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Configuring a node daemon on a newly added node will need all ssconf values. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Commit 224ff0f7 modified the node SSH setup to use the system's SSH client. Before that Paramiko was used. It's not entirely clear whehter the latter ever supported IPv6 properly, but with this patch “bootstrap.RunNodeSetupCmd” is changed to use it if configured. The code for doing so is taken from “bootstrap.SetupNodeDaemon”, which is going to use “bootstrap.RunNodeSetupCmd”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Part of the code used for running “prepare-node-join” can be re-used for running a tool to configure the node daemon. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
A new utility for configuring the node daemon will support a dry-run mode. This patch adds the necessary functionality to “ssconf.SimpleStore” and provides comprehensive tests for “SimpleStore.WriteFiles”. To enable the latter, a testing-only parameter specifying the lockfile was added to the class. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
The new utility for configuring the node daemon will have to check whether it received valid ssconf names. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Add the design document for opportunistic locking. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
This function can be applied to any type of class "Element" but its internal variables used to refer to a list of tuples containing these elements and their names as "nodes". Moreover it built a list of name to indices tuples referring to it as "na" (which is not very clear). Thus nodes becomes name_element, and na name_idx. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Dimitris Aragiorgis authored
In case conflicts are checked, log warnings if nodes' IPs cannot be reserved. Signed-off-by:
Dimitris Aragiorgis <dimara@grnet.gr> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Dimitris Aragiorgis authored
Signed-off-by:
Dimitris Aragiorgis <dimara@grnet.gr> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Dimitris Aragiorgis authored
Ensure that locks are held only if needed. Add conflicts_check in OpNetworkAdd. This is needed if we want to check whether nodes/master IPs are included in network. Depending on conflicts_check value, we have to hold node/instance locks during OpNetworkAdd/OpNetworkConnect or not. Signed-off-by:
Dimitris Aragiorgis <dimara@grnet.gr> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michele Tartara authored
The serialization itself is done by Text.JSON, so the tests deal with checking that Text.JSON objects are created correctly from the DRBD parser data structures. Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michele Tartara authored
The serialized JSON is not a 1:1 dump of the data structures populated by the parser. This is done intentionally, with the aim of producing a more stable and more meaningful output to be used by the (future) monitoring agent and stand-alone data collectors. Also: * shorten the names of some data types. * change data type for the fields of the Time data structure Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michele Tartara authored
The new support functions in module Ganeti.JSON will be used by the next commits to build JSON objects with optional (Maybe) fields, excluding them when they contain Nothing. Signed-off-by:
Michele Tartara <mtartara@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
This improves Issue 325 - new runtime and memory consumption is about 1/10 compared to before. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
Given a node list in input, we get an instance that had nodes in it. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
This takes an instance generator and produces a possibly empty list of instances. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
This generates a minimum of one node, because legal clusters never have zero nodes. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
hbal doesn't have any "-o" option, but on the other hand supports -S (described below, but not present in the short summary) Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Nov 30, 2012
-
-
Guido Trotter authored
This is used only once when testing Cluster.hs, but having it abstracted clarifies there what that call is about, makes that test shorter, and allows us to better do refactoring of the main genInstanceSmallerThan generator. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
The new one is more consistent with the rest of the nodegroup terminology and more generic for use in different htools. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
It turns out that in newer GHC versions, the suffix shouldn't be prefixed with a dot; otherwise name mangling is broken. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently, the And and Or filters use very nice code, e.g. in case of OrFilter: any id <$> mapM evaluateFilter flts However, looking at the memory profiles shows that application of any/id to monadic values via '<$>' does not work nicely, losing the 'early' success property. This results in too much memory being used for thunks in monadic sequencing. Rather than trying to add more strictness (not sure exactly how, TBH), switching these to explicit recursion solves the problem, since we take the 'early' exit problem in our hands and we are explicit about it. Memory usage in case of big (e.g. 1000 'Or' elements) is reduced significantly, and thus also the runtime. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Currently, the query operators (binop, etc.) create thunks, instead of forcing the evaluation of the simple boolean results. This results in higher than needed memory use. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
Since this program is not built normally, a few recent commits broke it: - 707cd3d7 (“Use exitErr instead of explicit error message and exitWith”) introduced wrong syntax (missing '$') - 29a30533 (“Remove unsafePerformIO usage”) changed the signature of G.Path.clusterConfFile - 5183e8be (“Convert query path from string errors to GanetiException”) changed the signature of 'getNode' Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
I've been bitten a couple of times with arbitrary opcodes working on UTF-8 locale, but failing on buildbot (ASCII). So let's add an explicit test that checks always (even with UTF-8) for correct arbitrary values, showing explicitly which opcodes fail. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-
Iustin Pop authored
It turns out that optimising 'read' derived instances (via -O) for complex data types (like OpCode, or the various objects) can be slow to very slow. Disabling such instances results in (time make $all_our_haskell_binaries) large compile-time savings and also smaller (unstripped) binaries (by a significant amount): ghc 6.12: time htools sz hconfd sz with read: 4m50s 12,244,694 14,927,928 no read: 3m30s 10,234,305 12,536,745 ghc 7.6: with read: 14m45s 13,694,761 15,741,755 no read: 3m40s 11,631,373 13,245,134 So let's remove these instances, since we never use read in production for our custom types, and even when debugging in GHCI, we can simply use the 'show' representation to create the types, without needing to actually parse from strings. Note: for the very slow ghc 7.6 compilation time, I filled a ticket (ghc #7450), since it is surprising(ly slow). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michele Tartara <mtartara@google.com>
-
Iustin Pop authored
This is the last inline-written field; I've done it separately from the last patch due to changes being needed in HTools (field changed type). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
-