- Jan 16, 2012
-
-
René Nussbaumer authored
Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
René Nussbaumer authored
Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jan 13, 2012
-
-
Iustin Pop authored
Learning, learning. It turns out that for objects with even just five fields, generating them and filtering can be costly, especially when the filtering is nested (as it was in this case, arbitrary1 → arbitrary2 + filter on arbitrary1 → arbitrary plus filter on aribitrary2). Changing the code to generate directly the good values speeds things up significantly. Additionally, we also generate correctly unique lists of disk templates (again, this should be a set, not a list, but…). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
It could happen that the node is generated with 0 disk available, in which case the operation will fail due to disk issues, not CPU. Fix this by using the recently-introduced genOnlineNode helper. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
As a followup from "Remove extraneous check in policy creation", there are more places where we build an ipolicy, and then manually check for its validity. This is very bad style, as it duplicates the verification code across many places. This patch removes all such explicit checks (except for one in cmdlib.py which is correct), and instead does a bit more validation in the builder functions or in the actual dedicated verification functions. It also fixes cluster init which used the wrong, non-completed ipolicy (this was not detected before as we did call check on it, but otherwise we ignored it), and fixes a too-strong assert (due to the call chain, we first create the ipolicy from cmdline params, and only then we fill it). Finally, it removes an extraneous logging.info which I forgot from debugging. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Another "good" seed value manages to generate nodes with identical names, which of course makes the sets be of smaller value than the lists. Avoid this issue by generating unique node names. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
While wondering why Cluster.tryReloc is not unit-tested, I realised that this is no longer uses. Apparently, last summer's new IAllocator modes and related changes have silently deprecated this function. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This patch fixes two ugly but non-critical issues: - the getFQDN wrongly generated only the first component as limited-length name, the rest could be any length, and that makes the generated name bad for display purposes - the random generator had real issues in finding an offline instance with the right properties when starting from certain seeds (found accidentally); this meant the test took 1 minute, instead of ~300ms, for the node_addSecOffline Furthermore, for the same evil seed, the Container_findByName test wasn't able to generate enough good data, so we change its implementation to directly generate an uniques list, instead of generating random lists and filtering the unique ones. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Currently they only check for change secondary, via iallocator's relocate method. We add two separate unittests that checks all the node evacuate modes (ChangeAll, ChangePrimary) and also the group change request. All of these are done only for DRBD instances. The patch also enhances an error message in Cluster.findBestAllocGroup for invalid input data (guess how this was detected…). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
… instead of always using "printTestCase … False". Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This adds a new optional (so we're backwards-compat) section to the cluster data so that we can reliably save/restore the policy data. Note that different from the other sections, we save all policies together and separately from the group data. I thought this is cleaner than extending adding the policy data near each group, and a new section just for the cluster policy. This change also allows simplification of the unittest for cluster create/serialize, although we would need a more complete test (right now we only dump/load the defIPolicy or nullIPolicy). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is unfortunately a complex test that checks if: - starting from a empty cluster - allocating a few instances on it - serialising it via the Text backend - loading it back into internal data structures we end up with the same thing. More precisely, it checks that the cluster after dump/load is the same as after allocation. While this is in the Text unittests, as the docstring saying, this check more stuff than just the dump/load. It increases the overall coverage by about 3%. There were a few changes needed for this unittest: adding some Eq instances for some data types, and fixing a cosmetic bug in Cluster.iterateAlloc, where the instance indices were growing by 2 instead of by 1 in each round. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Nothing breaks otherwise in the cluster routines, but serialisation to/from text gets confused otherwise. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This abstracts the concept of "give an sane, online node" in a single place, rather than spread around the tests. We also change the signature for isNodeBig for easier usage. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The addition of the offline state for instances has introduced a few bugs related to their handling. The current code adds a helper function for making the check whether an instances uses reserved memory on the secondary (and uses it instead of just autoBalance), and furthermore uses consistently the state for primary node operations. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Currently, in the human-readable mode, hspace doesn't show any messages when no instances can be allocated in tiered-alloc mode. This is confusing, so let's add an explicit message. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This currently checks the minimum/maximum sizes and the disk template. Unittests will come later. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
In order to be able to use the group policy during allocation, we have a few choices: - pass the group policy as a separate argument to all involved functions, or - add the policy as an attribute to nodes, or - add the group (not only the group index) as an attribute to nodes The first and last one would change more than wanted for this patch, so I went with the second one; it will allow easily checking the target policy at runtime (based on the instance's primary node), with the only downside that without a node, we can't check the policy. Note that the first option also would complicate the allocation routines, which examine (big) lists of node/node pairs, so adding the group to this would complicate things even more. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
During loading, we can eliminate some intermediate data structures. This only matters for big clusters, and even there it's less than 1% less memory allocated, but still, it's a no-brainer. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is not in the hot-path, but still, no sense in doing O(n) instead of O(1). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is straightforward; as before, so far the text and simu backends have no way to use a non-default ipolicy. Furthermore, we do some unit-test preparation for future changes (these seem a no-op for now, but they are needed for later patches). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is needed for the next patch. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The default disk template is the first enabled template. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The default value is badly defined (hardcoded defaults)… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is needed since we'll need the DiskTemplate definition in the IPolicy one. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is a bit more complex patch, as it requires changing the assumption that all keys in the policy dict points to values that are themselves dicts. Right now we introduce an assumption that any non-dicts are lists, we'll see in the future if this holds or whether we need more complex type checking (manual, yay Python). The patch also does some trivial style changes. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The values are already checked in CreateIPolicy, no need to manually check them again. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Currently these are defined twice, instead of a single time in cli.py. Also adds the new disk_templates option to the common block, even though it's not yet used. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This simply splits the value in the option parser, instead of needing to do it in the client code. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This code raises a configuration error, but we need to transform it into a prereq error (or possibly exec error), depending on when we call this function. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This changes from the current hardcoded defaults to the cluster policy. The command line options now override the defaults from the cluster, and the tiered spec mode is always enabled. Also fixes a tiny typo in the man page (together with the man page updates). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The rspec type is simpler than the ispec one; most likely it should be deprecated later. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This requires changing from querying the /tags resource to the /info resource. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Recent changes to the instance beparams have replaced memory with maxmem in Rapi bulk queries. Until this is either reverted (for backwards compat) or we decide to go ahead with only maxmem, we change the backend to read both; this only affects the "instance down" code path (where ``oper_ram`` is missing). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-