While changes with no net effect wouldn't hurt any correctness
properties, still the modification time and serial of the maintenance
entry in the configuration would be changed and the configuration
distributed to all master candidates. These unexpected configuration
changes can be confusing; they definitely do confuse some QA tests.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 src/Ganeti/MaintD/Server.hs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/Ganeti/MaintD/Server.hs b/src/Ganeti/MaintD/Server.hs
index c68c7e3..b6feede 100644
--- a/src/Ganeti/MaintD/Server.hs
+++ b/src/Ganeti/MaintD/Server.hs
@@ -127,14 +127,16 @@ maintenance memstate = do
             . tryIOError $ L.getLuxiClient luxiSocket)
           (liftIO . L.closeClient)
           $ void . mkResultT . waitForJobs oldjobs
-  liftIO $ clearJobs memstate
+  unless (null oldjobs)
+    . liftIO $ clearJobs memstate
   logDebug "New round of maintenance started"
   cData <- loadClusterData
   let il = cdInstances cData
       nl = cdNodes cData
       nidxs = Set.fromList $ Container.keys nl
   (nidxs', jobs) <- harepTasks (nl, il) nidxs
-  liftIO $ appendJobs memstate jobs
+  unless (null oldjobs)
+   . liftIO $ appendJobs memstate jobs
   logDebug $ "Unaffected nodes " ++ show (Set.toList nidxs')
              ++ ", jobs submitted " ++ show (map fromJobId jobs)
 
-- 
2.4.3.573.g4eafbef

Reply via email to