]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: don't propose new state from update_from_paxos
authorSage Weil <sage.weil@dreamhost.com>
Fri, 18 Nov 2011 04:45:54 +0000 (20:45 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 18 Nov 2011 04:45:54 +0000 (20:45 -0800)
Proposing a new state from within update_from_paxos() confuses some callers,
like PaxosService::_active().  Instead, do it in the on_active() callback.
This also let's us collapse the check_osd_map() caller into on_active(),
and makes it happen on leaders and peons alike, which ought to avoid some
of the pg creation lag we see sometimes (presumably when the osds have
sessions with peons instead of the leader).

Fixes: #1708
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mon/PGMonitor.cc

index 1a21a291a04228aee927bb79d08399ae1a2cfb8f..b12d08e65f8b7735f1db9783fc257a16be72da30 100644 (file)
@@ -95,6 +95,7 @@ void PGMonitor::on_active()
   if (mon->is_leader()) {
     check_osd_map(mon->osdmon()->osdmap.epoch);
   }
+  send_pg_creates();
 }
 
 void PGMonitor::tick() 
@@ -183,8 +184,6 @@ bool PGMonitor::update_from_paxos()
       paxosv > max)
     paxos->trim_to(paxosv - max);
 
-  send_pg_creates();
-
   return true;
 }
 
@@ -566,8 +565,6 @@ void PGMonitor::check_osd_map(epoch_t epoch)
   
   if (propose)
     propose_pending();
-
-  send_pg_creates();
 }
 
 void PGMonitor::register_pg(pg_pool_t& pool, pg_t pgid, epoch_t epoch, bool new_pool)