Commit 7d6e577c authored by Petr Pudlak's avatar Petr Pudlak
Browse files

Log asynchronous WConfd tasks and include the serial number



This makes debugging more informative and makes more clear how
configuration distribution gets aggregated.
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 579bd910
......@@ -73,7 +73,8 @@ loadConfigFromFile path = withLockedFile path $ \_ -> do
writeConfigToFile :: (MonadBase IO m, MonadError GanetiException m, MonadLog m)
=> ConfigData -> FilePath -> FStat -> m FStat
writeConfigToFile cfg path oldstat = do
logDebug "Async. config. writer: Commencing write"
logDebug $ "Async. config. writer: Commencing write\
\ serial no " ++ show (serialOf cfg)
r <- toErrorBase $ atomicUpdateLockedFile_ path oldstat doWrite
logDebug "Async. config. writer: written"
return r
......@@ -161,8 +162,11 @@ distMCsAsyncTask ents cpath cdRef =
\ to master candidates"
$ do
cd <- liftBase (csConfigData <$> cdRef) :: ResultG ConfigData
logDebug $ "Distributing the configuration to master candidates,\
\ serial no " ++ show (serialOf cd)
fupload <- prepareRpcCallUploadFile ents cpath
execRpcCallAndLog (getMasterCandidates cd) fupload
logDebug "Successfully finished distributing the configuration"
-- | Construct an asynchronous worker whose action is to construct SSConf
-- and distribute it to master candidates.
......@@ -177,7 +181,12 @@ distSSConfAsyncTask cdRef =
$ \oldssc -> do
cd <- liftBase (csConfigData <$> cdRef) :: ResultG ConfigData
let ssc = mkSSConf cd
when (oldssc /= ssc)
$ execRpcCallAndLog (getOnlineNodes cd)
if oldssc == ssc
then logDebug "SSConf unchanged, not distributing"
else do
logDebug $ "Starting the distribution of SSConf\
\ serial no " ++ show (serialOf cd)
execRpcCallAndLog (getOnlineNodes cd)
(RpcCallWriteSsconfFiles ssc)
logDebug "Successfully finished distributing SSConf"
return ssc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment