Also clean up stale livelock files
Upon detection of a stale livelock, make WConfD alsotry to clean it up. We can safely ignore any failures,as the Ganeti resources are already freed, and the worstthing that can happen is an empty file left over in the...
In WConfD run a cleanup task
Add the cleanup task for locks of died owners to WConfD,as a separate thread.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Petr Pudlak <pudlak@google.com>
Provide a periodic lock cleanup task
Provide a task that periodically checks for all locksowners whether they are still alive. If not, it cleansup their locks.
Add a function to detect death of a job
With jobs running in processes different from the lock management soon,we need to detect if a job holding locks dies, in order to release theresources.
Write lock state to disk after updates
Make use of asynchronous worker to save to log status after everyupdate. The answer to the query is only returned, once the stateis saved on disk. Note that replication of the lock status is notnecessary, as all jobs will be gone if the master node goes away....
Export opportunistic lock union through WConfd
Make WConfD provide a function to opportunistically allocatelocks.
Export lock intersection through WConfD
Export the functionality to restrict the owned locks to a given set.
Export freeLocks through WConfD
Export the functionality to free all locks of a givenowner.
Add lock modification without result to WConfdMonad
Enrich the structure of WConfdMonad by a conveniencewrapper around modifyLockAllocation for the case thatthe modification always succeeds and does not produceany result.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Export updateLocks through WConfD
Export the functionality to update the locks of a givenowner through WConfD.
Add serialization for LockRequest GanetiLocks
Add a module describing how abstract requests, like lock requests arepassed over the wire to WConfD.
Export listing of locks
Make WconfD answer requests about the locks of a specificowner.
Support reading the lock allocation in WConfdMonad
As opposed to the atomic modify-and-read provided my modifyLockAllocation,no storing is necessary here.
Remove the client state from WConfD monad
As we decided to keep our protocols stateless, the clientstate is no longer needed.
Add the --force-node option to WConfd
.. and fix the superfluous options list in ganeti-wconfd.hs
Signed-off-by: Petr Pudlak <pudlak@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Prefer unless over when (not...)
...and by doing so, please lint.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
At startup, make WConfD read the lock allocation from disk
On startup, make wconfd read a the state of the lock allocation from disk,instead of starting from an empty allocation.
Note that, as opposed to the configuration, no finding a savedlog configuration is not an error; e.g., the node might be master...
Export reading and writing the configuration using RPC
Note that currently these functions lack any kind of locking andconcurrent calls to 'writeConfig' will result in lost changes in theconfiguration.
Add a module for functions specific to config. management
.. and include ConfigData in WConfd's ConfigState.
Currently it includes functions for asynchronous saving theconfiguration and reading and (over)writing it in the daemon state.
Load the configuration from the file at daemon startup and configure an...
Add more general conf. handling functions to WConfd's Monad
Add functions for reading and writing the configuration. Writingtriggers the asynchronous worker which saves the configuration into themaster file. The actual action that saves the configuration is passed as...
Make the lock allocation part of WConfD's state
As WConfD is supposed to be the authoritative source forconfiguration and locks, it needs to have access to the lockstate as well.
Add the WConfD daemon itself
The daemon exposes the declared functions in Ganeti.WConfd.Core to RPCclients (currently just 'echo').
Add a module for WConfd core functions
There are no exported functions yet, except for `echo`, which justreturns its argument back to a client.
Add a monad for running all WConfD functions
This monad encapsulates working with the daemon and client state, aswell as failures and IO operations.