]> 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)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 29 Jan 2021 12:42:38 +0000 (13:42 +0100)
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>
(cherry picked from commit c1cee0a9526b21c848e8eff2bed585ee856e4497)

src/cephadm/cephadm

index 54a6672d705e359eced38f01be214751280f7e93..c3b0468f64677ae49152b5739a4cc3d812e2dc66 100755 (executable)
@@ -3731,8 +3731,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