]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor: use post_paxos_update, not init, to refresh from osdmap
authorSage Weil <sage@inktank.com>
Wed, 26 Jun 2013 13:53:08 +0000 (06:53 -0700)
committerSage Weil <sage@inktank.com>
Wed, 26 Jun 2013 13:55:02 +0000 (06:55 -0700)
We do two things here:
 - make init an one-time unconditional init method, which is what the
   health service expects/needs.
 - switch PGMonitor::init to be post_paxos_update() which is called after
   the other services update, which is what PGMonitor really needs.

This is a new version of the fix originally in commit
a2fe0137946541e7b3b537698e1865fbce974ca6 (and those around it).  That is,
this re-fixes a problem where osds do not see pg creates from their
subscribe due to map_pg_creates() not getting called.

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.cc
src/mon/PGMonitor.cc
src/mon/PGMonitor.h

index 42bf9d5ac0b66c2ab53a7d62a2d27a79393dc8c9..3c33189ab609509d9362b1c2e53700a07256bb7e 100644 (file)
@@ -520,14 +520,14 @@ void Monitor::init_paxos()
   dout(10) << __func__ << dendl;
   paxos->init();
 
+  // init services
+  for (int i = 0; i < PAXOS_NUM; ++i) {
+    paxos_service[i]->init();
+  }
+
   // update paxos
   if (paxos->is_consistent()) {
     refresh_from_paxos(NULL);
-
-    // init services
-    for (int i = 0; i < PAXOS_NUM; ++i) {
-      paxos_service[i]->init();
-    }
   }
 }
 
index 479b498f934ed05e6b9fba205b7b5631a9af9da3..88208354c8ea6588126a66036bfcb2dc10e5ffaf 100644 (file)
@@ -271,7 +271,7 @@ void PGMonitor::upgrade_format()
   propose_pending();
 }
 
-void PGMonitor::init()
+void PGMonitor::post_paxos_update()
 {
   if (mon->osdmon()->osdmap.get_epoch()) {
     map_pg_creates();
index f8cf279a3b1f12dbe6024ef1f74345a3ae9cfa8e..8117ee2bba8adaf9446e972c2a87475ec0c29d00 100644 (file)
@@ -53,7 +53,7 @@ private:
   void create_initial();
   void update_from_paxos(bool *need_bootstrap);
   void upgrade_format();
-  void init();
+  void post_paxos_update();
   void handle_osd_timeouts();
   void create_pending();  // prepare a new pending
   // propose pending update to peers