]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph_monstore_tool: include mgrmap in initial paxos epoch 20116/head
authorKefu Chai <kchai@redhat.com>
Thu, 4 Jan 2018 05:06:52 +0000 (13:06 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 25 Jan 2018 12:46:27 +0000 (13:46 +0100)
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 <kchai@redhat.com>
(cherry picked from commit f3f2a8bad4da7fda485eba7412d40b7b5758452d)

src/tools/ceph_monstore_tool.cc

index 8865cba378dd1a4bd061ac64f5b3be835ce8028b..4d6a8bdb7323011fb0d4a925abf313f7450075c7 100644 (file)
@@ -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<MonitorDBStore::Transaction>();
@@ -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;
 }