From f3f2a8bad4da7fda485eba7412d40b7b5758452d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 4 Jan 2018 13:06:52 +0800 Subject: [PATCH] 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 --- src/tools/ceph_monstore_tool.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tools/ceph_monstore_tool.cc b/src/tools/ceph_monstore_tool.cc index 3d35d2cd6fbb4..7fbfb6c17bbcf 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; } -- 2.47.3