]> 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>
Fri, 28 Jun 2013 22:43:58 +0000 (15:43 -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>
(cherry picked from commit e635c47851d185eda557e36bdc4bf3775f7b87a2)

Conflicts:
src/mon/PGMonitor.cc
src/mon/PGMonitor.h

src/mon/Monitor.cc
src/mon/PGMonitor.cc
src/mon/PGMonitor.h

index 89778053cfc8a8439a19931b5d25d3cd38cdd0a2..1ca6de2987e517e2a38b4fb3c4b60612ee7a78e3 100644 (file)
@@ -514,14 +514,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 da648c77dfa1b77e7eb3ae364c3270d1c6bf89c0..ae504c1221be11e9cccfe14dc326ff4c6a0bd3a0 100644 (file)
@@ -219,7 +219,7 @@ void PGMonitor::update_from_paxos(bool *need_bootstrap)
   update_logger();
 }
 
-void PGMonitor::init()
+void PGMonitor::post_paxos_update()
 {
   if (mon->osdmon()->osdmap.get_epoch()) {
     map_pg_creates();
index 7f04fec12566e48323c6f4e1f4d1a1b3354f73ef..e15b33cc886c4e33e54bfb9d48397f5973c67a5d 100644 (file)
@@ -52,7 +52,7 @@ private:
 
   void create_initial();
   void update_from_paxos(bool *need_bootstrap);
-  void init();
+  void post_paxos_update();
   void handle_osd_timeouts();
   void create_pending();  // prepare a new pending
   // propose pending update to peers