From: Sage Weil Date: Fri, 22 Jan 2021 15:06:44 +0000 (-0600) Subject: cephadm: try 'mgr stat' before 'mgr dump' to get the epoch X-Git-Tag: v17.1.0~3162^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c1cee0a9526b21c848e8eff2bed585ee856e4497;p=ceph.git cephadm: try 'mgr stat' before 'mgr dump' to get the epoch 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 --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 1f0e178caaca..0cafc2ea33d1 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -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