]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: try 'mgr stat' before 'mgr dump' to get the epoch
authorSage Weil <sage@newdream.net>
Fri, 22 Jan 2021 15:06:44 +0000 (09:06 -0600)
committerSage Weil <sage@newdream.net>
Mon, 25 Jan 2021 14:48:44 +0000 (08:48 -0600)
This is less noise in the debug log.  (Also, there seems to be a problem
when the mgr stat output gets too big.)

Signed-off-by: Sage Weil <sage@newdream.net>
src/cephadm/cephadm

index 1f0e178caaca22e177abb34d67b8933912cc54e8..0cafc2ea33d191077be5c66a806185346a50d8c6 100755 (executable)
@@ -3707,8 +3707,13 @@ def command_bootstrap(ctx):
 
     # wait for mgr to restart (after enabling a module)
     def wait_for_mgr_restart():
-        # first get latest mgrmap epoch from the mon
-        out = cli(['mgr', 'dump'])
+        # first get latest mgrmap epoch from the mon.  try newer 'mgr
+        # stat' command first, then fall back to 'mgr dump' if
+        # necessary
+        try:
+            out = cli(['mgr', 'stat'])
+        except Exception as e:
+            out = cli(['mgr', 'dump'])
         j = json.loads(out)
         epoch = j['epoch']
         # wait for mgr to have it