Allow transitions from sets to elements
Owning a set-lock has the same effect as owning each member. So askingfor a member while already holding the set lock in the same mode (sharedor exclusive) is, effectively, no asking for new locks. Therefore, do not...
Fix typo
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Petr Pudlak <pudlak@google.com>
Add a function to determine the lock owners
To allow for clean up, add a function that provides the listof all the owners holding at least one lock.
Provide an asynchronous task for writing lock status
It will be used to persist the state of the lock allocation ondisk, allowing locks to survive reboots of WConfD.
Add Ganeti Lock Hierarchy
Make Ganeti.Locking.Locks.GanetiLocks present the full Ganetilock hierarchy. This is in accordance with the current Pythonimplementation.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Petr Pudlak <pudlak@google.com>...
Serialize locks as JSON strings
...as the current Python implementation does as well.
Locks are owned by job id file path pairs
...according to our updated design.
Add a function to load lock allocation from disk
Lock allocation are stored on disk as their JSON representation.
Make Locks a JSON instance
As requests to acquire or release locks come viainter-process communication, we need a serializationof the locks data type.
All locks are serialised as JSON objects, where thekey "type" describes the type of lock, and the remaining...
Make LockAllocation an instance of JSON
In this way, we can serialize a lock state to disk, so thatlocks can survive a restart of WConfD.
View revisions
Also available in: Atom