- Mar 04, 2008
-
-
Guido Trotter authored
Previously the private version of the __names function returned directly a set. We'll keep this in the public interface but change the private version to a list in order to be able to sort() its result and then loop on it, even though we'll need to do this with the usual care that some keys may disappear in between. Reviewed-by: imsnah
-
Guido Trotter authored
Lockset's remove() function used to return a list of locks we failed to remove. Rather than doing this we'll return a list of removed locks, so it's more similar to how acquire() behaves. This patch also fixes the relevant unit tests. Reviewed-by: imsnah
-
Guido Trotter authored
In a LockSet acquire() returned True on success. This code changes that to return a set containing the names of the elements acquired. This is still a true value if we acquired any lock but is slightly more useful (because if needed one has access to this data without querying for it). The only change happens if acquiring no locks, which though is a usage which should not normally happen because it has no practical use. The patch also changes a some tests to check that the new format is respected. Reviewed-by: imsnah
-
Guido Trotter authored
This patch changes nothing to the functionality of a LockSet. Rather than trying to do the whole for loop we try each of its steps. This opens the way to handle differently a single failure. Reviewed-by: imsnah
-
Guido Trotter authored
Includes some locking-related constants and explanations on how the LockManager should be used, the class itself and its test cases. The class includes: - a basic constructor - functions to acquire and release lists of locks at the same level - functions to add and remove list of locks at modifiable levels - dynamic checks against out-of-order acquisitions and other illegal ops Its testing library checks that the LockManager behaves correctly and that the external assumptions it relies on are respected. Reviewed-by: imsnah
-
- Feb 29, 2008
-
-
Iustin Pop authored
Currently the cluster destroy doesn't remove the master role, which means that the IP address of the cluster remains assigned to the master node. This patch fixes this and also a docstring in backend.StopMaster(). Reviewed-by: imsnah
-
Iustin Pop authored
Reviewed-by: imsnah
-
Iustin Pop authored
This one-liner fixes the cluster rename operation. As a side note, we should have a QA test for this too. Reviewed-by: imsnah
-
- Feb 28, 2008
-
-
Guido Trotter authored
This patch makes acquire() first look up all the locks in the dict and then try to acquire them later. The advantage is that if a lockname is already wrong since the beginning we won't need to first queue and acquire other locks to find this out. Of course since there is no locking between the two steps a delete() could still happen in between, but SharedLocks are safe in this regard and will just make the .acquire() operation fail if this unfortunate condition happens. Since the right way to check if an instance/node exists and make sure it won't stop existing after that is acquiring its lock this improves the common case (checking for an incorrect name) while not penalizing correctness, or performance as would happen if we kept a lock for the whole process. Reviewed-by: iustinp
-
Guido Trotter authored
A LockSet represents locking for a set of resources of the same type. A thread can acquire multiple resources at the same time, and release some or all of them, but cannot acquire more resources incrementally at different times without releasing all of them in between. Internally a LockSet uses a SharedLock for each resource to be able to grant both exclusive and shared acquisition. It also supports safe addition and removal of resources at runtime. Acquisitions are ordered alphabetically in order to grant them to be deadlock-free. A lot of assumptions about how the code interacts are made in order to grant both safety and speed; in order to document all of them the code features pretty lenghty comments. The test suit tries to catch most common interactions but cannot really tests tight race conditions, for which we still need to rely on human checking. This is the second basic building block for the Ganeti Lock Manager. Instance and Node locks will be put in LockSets to manage their acquisition and release. Reviewed-by: imsnah
-
Guido Trotter authored
Some options were missing in the gnt-cluster init man page. This patch adds them, removes an empty line, and clarifies a bit more some requirements. Reviewed-by: schreiberal
-
Guido Trotter authored
Even if the target instance is down or we are not checking for IP conflicts changing an instance name to a new one which is already in the cluster is doomed to fail, because in a lot of places (among which figures the mind of most users/admins) instance names are assumed to be unique. Reviewed-by: imsnah
-
Alexander Schreiber authored
Reviewed-by: imsnah
-
- Feb 27, 2008
-
-
Michael Hanselmann authored
Reviewed-by: iustinp
-
Michael Hanselmann authored
Reviewed-by: ultrotter
-
- Feb 26, 2008
-
-
Michael Hanselmann authored
Reviewed-by: iustinp
-
Michael Hanselmann authored
Reviewed-by: iustin
-
- Feb 25, 2008
-
-
Michael Hanselmann authored
Change comments to printed information, some cleanup. These changes are from November 2007. The test is not perfect yet. Reviewed-by: iustinp
-
Manuel Franceschini authored
This patch replaces some hardcoded strings with their corresponding constant in `_GenerateDiskTemplate()`. Reviewed-by: iustinp
-
- Feb 23, 2008
-
-
Guido Trotter authored
The cron file in ganeti's example directory is now static, and executes ganeti-watcher in /usr/local/sbin no matter where it's really installed. With this patch we generate it at build time substituting the right value of @SBINDIR@ from ganeti.cron.in. We also make sure ganeti-watcher exists and is executable before running it. This is targeted at 1.2 as well. Reviewed-by: iustinp
-
- Feb 22, 2008
-
-
Manuel Franceschini authored
-
Manuel Franceschini authored
-
Iustin Pop authored
This patch switches from the twisted usage for inter-node protocol to simple BaseHTTPServer/httplib. The patch has more deletions because we use no authentication, no encryption at all. As such, this is just for trunk, and only for testing. What it brings is the ability to use the rpc library from within multiple threads in parallel (or it should so). Since the changes are very few and non-intrusive, they can be reverted without impacting the rest of the code. This passes burnin. QA was not tested. Reviewed-by: imsnah
-
- Feb 21, 2008
-
-
Guido Trotter authored
- Check that even a shared acquire() fails on a deleted lock - Check that delete() fails on a lock you share (must own it or nothing) These are assumptions I build on in future code, so better check for them. Currently no code change is necessary for them to be valid. Reviewed-by: iustinp
-
- Feb 20, 2008
-
-
Guido Trotter authored
The _doItDelete helper code was supposed to be used to dispatch threads that deleted the SharedLock. It actually just acquired it exclusively. This remained unnoticed as the helper thread is just used to test interaction, not the delete code by itself, and delete requires an exclusive acquire anyway. Reviewed-by: imsnah
-
Guido Trotter authored
gnt-instance replace-disks used to be called replace_disks. Reviewed-by: iustinp
-
- Feb 19, 2008
-
-
Guido Trotter authored
This new operation lets a lock be cleanly deleted. The lock will be exclusively held before deletion, and after it pending and future acquires will raise an exception. Other SharedLock operations are modify to deal with delete() and to avoid code duplication. This patch also adds unit testing for the new function and its interaction with the other lock features. The helper threads are sligtly modified to handle and report the condition of a deleted lock. As a bonus a non-related unit test about not supporting non-blocking mode yet has been added as well. This feature will be used by the LockSet in order to support deadlock-free delete of resources. This in turn will be useful to gracefully handle the removal of instances and nodes from the cluster dealing with the fact that other operations may be pending on them. Reviewed-by: iustinp
-
- Feb 18, 2008
-
-
Guido Trotter authored
Use the actual class name rather than a spaced version of it. Reviewed-by: iustinp
-
Iustin Pop authored
Note: we don't update for now the install.sgml file with the new version number, as there are no other changes. We'll update the web site to indicate that the current install.html document is valid for 1.2.3 too. Reviewed-by: imsnah,ultrotter
-
Iustin Pop authored
This reverts commit 604 as the upgrade tool should not be in the 1.3 branch. Reviewed-by: schreiberal
-
Alexander Schreiber authored
Reviewed-by: imsnah
-
Iustin Pop authored
This patch adds the DRBD upgrade tool in the archive and in the installed tools dir, and its associated README in the doc_DATA target. Reviewed-by: ultrotter
-
- Feb 16, 2008
-
-
Guido Trotter authored
Due to an indentation error only the last instance queried got returned by LUQueryInstanceData. Moving the append() call inside the for cycle to fix this issue. This is a one-liner targeted at 1.2.3 Reviewed-by: iustinp
-
- Feb 15, 2008
-
-
Michael Hanselmann authored
Reviewed-by: iustinp
-
Iustin Pop authored
QA suite which tests gnt-instance modify has uncovered another issue related to mac export. Reviewed-by: imsnah
-
- Feb 14, 2008
-
-
Iustin Pop authored
This tiny patch fixes the breakage that the previous patch about activation did by removing the Close() call after activation. The initial reason for that call was that if the device is already active and open, but we need it closed, we close it automatically. This however conflicts with the 2-step open in the case the instance is already open. It makes sense to remove the call since in the current Ganeti setup, just doing Close() is not enough to change the device from (e.g.) primary to secondary, as some devices (e.g. md) might need Shutdown not Close. It also gets rid of a Close() in the CreateBlockDevice function, due to the same reasoning (although in Create the child should not have a different status anyway). Reviewed-by: imsnah
-
Iustin Pop authored
This tiny patch fixes the verbose option to actually work, and also when creating instances it logs the secondary node too (even if this doesn't apply for plain templates, it doesn't create an error). Reviewed-by: imsnah
-
Iustin Pop authored
This patch adds a new field available for selection in gnt-instance list names "status" which represents the combined value of "admin_state" and "oper_state". Since this is much easier to parse (e.g. gnt-instance list |grep ERROR), we also modify the default field list to use this instead of the admin/oper state fields. Reviewed-by: imsnah
-
Michael Hanselmann authored
Reviewed-by: iustinp
-
- Feb 12, 2008
-
-
Guido Trotter authored
DRBD 8.2 uses a double integer field ad protocol version, rather than a single one. This patch fixes the ganeti parsing code, allowing both the old and the new version type. In order to do so the internal _GetVersion function is changed to return a dict, rather than a list, and the second protocol field is added, only if present, as proto2. This is a fix for issue 24. Reviewed-by: iustinp
-