]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: only map/send pg creations if osdmap is defined
authorSage Weil <sage@inktank.com>
Mon, 29 Apr 2013 18:11:24 +0000 (11:11 -0700)
committerSage Weil <sage@inktank.com>
Mon, 29 Apr 2013 18:11:24 +0000 (11:11 -0700)
This avoids calculating new pg creation mappings if the osdmap isn't
loaded yet, which currently happens when during Monitor::paxos_init()
on startup.  Assuming osdmap epoch is nonzero, it should always be
safe to do this (although possibly unnecessary).

More cleanup here is certainly possible, but this is one step toward fixing
the bad behavior for #4675.

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

index 5f325b9846c67e6522eda382a27e18b9dec6437b..772b2a435a47984e108741ee1a022aa79a400bc8 100644 (file)
@@ -212,8 +212,10 @@ void PGMonitor::update_from_paxos()
 
   update_trim();
 
-  map_pg_creates();
-  send_pg_creates();
+  if (mon->osdmon()->osdmap.get_epoch()) {
+    map_pg_creates();
+    send_pg_creates();
+  }
 
   update_logger();
 }
@@ -665,8 +667,10 @@ void PGMonitor::check_osd_map(epoch_t epoch)
   if (propose)
     propose_pending();
 
-  map_pg_creates();
-  send_pg_creates();
+  if (mon->osdmon()->osdmap.get_epoch()) {
+    map_pg_creates();
+    send_pg_creates();
+  }
 }
 
 void PGMonitor::register_pg(pg_pool_t& pool, pg_t pgid, epoch_t epoch, bool new_pool)