History | View | Annotate | Download (17.8 kB)
Derive Ord for LockRequests
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Petr Pudlak <pudlak@google.com>
Add a function to provide all the full lock state
This function will be used to provide the information requiredto answer lock queries.
Add a function to obtain all active locks
Add a function that extracts from a LockAllocation the listof all locks that are in use (directly or indirectly).
Add a function for determining if a client holds a lock
This convenience function examines 'listLocks' for a particular ownerand checks, if it holds a given lock at a given ownership level (orhigher). Therefore checking for a shared locks returns 'True' if the...
Add convenience function to downgrade locks
Add a convenience function that downgrades all locks with a givenproperty to be held only at shared level.
Add a convenience function to release locks by property
While definable from listLocks and updateLocks, it is convenientto be able to all locks with a given property. This will, e.g.,allow to release all locks at a given level---as the mcpu doesroutinely....
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
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.
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.
Support opportunistic lock allocation
Add a function to opportunistically allocate as many locks of a givenset as possible. This is equivalent to sequentially try the locks inincreasing lock order after restricting to those locks where therequired owner state is higher than the currently held one....
Add a convenience function to restrict locks to a given set
As it is an operation the locking daemon is supposed to provide,add a function restricting the locks of a user to a given listand release all other locks.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Enforce the order restrictions on group locks
Disallow requests for an exclusive lock, if the owner alreadyholds a shared (and only shared) lock on a group lock that lockbelongs to.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Efficiently verify consistent lock requests
Most requests for lock updates are consistent and mentionevery lock only once. So verify this property efficientlyby comparing lengths. Only if the length do not coincidego through the actual (quadratic) comparison to find a...
Support lock implication in allocation
Make the module abstractly handling lock allocationhonor the additional restrictions caused by lockimplications.
Add a convenience function to free all locks of an owner
While freeing all locks of a single owner can easily be definedout of listLocks and updateLocks, it is worth having this functionin its own right. For example, it will be needed when the death of...
Add missing documentation to exported function listLocks
The module Ganeti.Locking.Allocation exports the function listLocks,hence a documentation string is required. Add it.
Add function describing lock updates
Add the pure part of the mechanism of updating locks. To allowfor efficient waiting on locks, return the set of owners of the lockson which the operation is blocked.
Add data structure representing current lock status
To allow for jobs as processes, a central daemon (wconfd) willhandle allocation and release of locks. Add an appropriate datastructure to describe the current status of the locks.