From: Kefu Chai Date: Thu, 4 Jan 2018 05:06:52 +0000 (+0800) Subject: tools/ceph_monstore_tool: include mgrmap in initial paxos epoch X-Git-Tag: v13.0.2~659^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F19780%2Fhead;p=ceph.git tools/ceph_monstore_tool: include mgrmap in initial paxos epoch before this change, the "mgr" map is not included paxos, thus why the peon mon fails to have the mgr map after it is sync'ed with its leader. and hence there is chance that ceph-mgr is unable to get a mgr map from the monitor it is connected to. Fixes: http://tracker.ceph.com/issues/22266 Signed-off-by: Kefu Chai --- diff --git a/src/tools/ceph_monstore_tool.cc b/src/tools/ceph_monstore_tool.cc index 3d35d2cd6fb..7fbfb6c17bb 100644 --- a/src/tools/ceph_monstore_tool.cc +++ b/src/tools/ceph_monstore_tool.cc @@ -591,6 +591,9 @@ static int update_monitor(MonitorDBStore& st) return 0; } +// rebuild +// - mgr +// - mgr_command_desc static int update_mgrmap(MonitorDBStore& st) { auto t = make_shared(); @@ -731,6 +734,9 @@ int rebuild_monstore(const char* progname, if ((r = update_pgmap_meta(st))) { return r; } + if ((r = update_mgrmap(st))) { + return r; + } if ((r = update_paxos(st))) { return r; } @@ -740,9 +746,6 @@ int rebuild_monstore(const char* progname, if ((r = update_monitor(st))) { return r; } - if ((r = update_mgrmap(st))) { - return r; - } return 0; }