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: v12.2.3~40^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cd9e6788cbb8ead60c82d15c574c5a00f4c1d222;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 (cherry picked from commit f3f2a8bad4da7fda485eba7412d40b7b5758452d) --- diff --git a/src/tools/ceph_monstore_tool.cc b/src/tools/ceph_monstore_tool.cc index 8865cba378d..4d6a8bdb732 100644 --- a/src/tools/ceph_monstore_tool.cc +++ b/src/tools/ceph_monstore_tool.cc @@ -592,6 +592,9 @@ static int update_monitor(MonitorDBStore& st) return 0; } +// rebuild +// - mgr +// - mgr_command_desc static int update_mgrmap(MonitorDBStore& st) { auto t = make_shared(); @@ -732,6 +735,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; } @@ -741,9 +747,6 @@ int rebuild_monstore(const char* progname, if ((r = update_monitor(st))) { return r; } - if ((r = update_mgrmap(st))) { - return r; - } return 0; }