As also suggested in the manual upgrade instructions,
pause the watcher (for 1h) during the upgrade. Fixes
issue 905.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 lib/client/gnt_cluster.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py
index 87860bd..96c115f 100644
--- a/lib/client/gnt_cluster.py
+++ b/lib/client/gnt_cluster.py
@@ -1841,6 +1841,10 @@ def _UpgradeBeforeConfigurationChange(versionstring):
     ToStderr("Failed to completely empty the queue.")
     return (False, rollback)
 
+  ToStdout("Pausing the watcher for one hour.")
+  rollback.append(lambda: GetClient().SetWatcherPause(None))
+  GetClient().SetWatcherPause(time.time() + 60 * 60)
+
   ToStdout("Stopping daemons on master node.")
   if not _RunCommandAndReport([pathutils.DAEMON_UTIL, "stop-all"]):
     return (False, rollback)
@@ -1971,6 +1975,10 @@ def _UpgradeAfterConfigurationChange(oldversion):
   if not _RunCommandAndReport([pathutils.POST_UPGRADE, oldversion]):
     returnvalue = 1
 
+  ToStdout("Unpasuing the watcher.")
+  if not _RunCommandAndReport(["gnt-cluster", "watcher", "continue"]):
+    returnvalue = 1
+
   ToStdout("Verifying cluster.")
   if not _RunCommandAndReport(["gnt-cluster", "verify"]):
     returnvalue = 1
-- 
2.1.0.rc2.206.gedb03e5

Reply via email to