]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: send osd map if MPGStats sender has an old map
authorSage Weil <sage@newdream.net>
Mon, 12 Oct 2009 17:53:39 +0000 (10:53 -0700)
committerSage Weil <sage@newdream.net>
Mon, 12 Oct 2009 18:38:56 +0000 (11:38 -0700)
src/TODO
src/mon/OSDMonitor.cc
src/mon/PGMonitor.cc

index e6a2a1b01fc1f1bd652f29713ebb0eb853815009..be1664e2d94a9bfcc20d074e06744d1b7afcd05e 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -46,7 +46,6 @@ v0.17
 - kill mon->osd
   - notify random osd when a map commits?
   - how to tell osds to scrub?
-  - send map on MPGStats, sometimes?
 
 - simplify msgr failure model
    mon<->mon lossless, p2p
index a795443ee6e8537d3aed8facca049f0fa9d5b768..0ac7f237fd9f489588282cdf8bd4e9918f63a0f4 100644 (file)
@@ -635,6 +635,7 @@ void OSDMonitor::send_to_waiting()
       if (from <= osdmap.get_epoch()) {
        while (!p->second.empty()) {
          send_incremental(p->second.front(), from);
+         delete p->second.front();
          p->second.pop_front();
        }
       } else {
@@ -645,6 +646,7 @@ void OSDMonitor::send_to_waiting()
     } else {
       while (!p->second.empty()) {
        send_full(p->second.front());
+       delete p->second.front();
        p->second.pop_front();
       }
     }
@@ -662,6 +664,7 @@ void OSDMonitor::send_latest(PaxosServiceMessage *m, epoch_t start)
       send_full(m);
     else
       send_incremental(m, start);
+    delete m;
   } else {
     dout(5) << "send_latest to " << m->get_orig_source_inst()
            << " start " << start << " later" << dendl;
@@ -674,7 +677,6 @@ void OSDMonitor::send_full(PaxosServiceMessage *m)
 {
   dout(5) << "send_full to " << m->get_orig_source_inst() << dendl;
   mon->send_reply(m, new MOSDMap(mon->monmap->fsid, &osdmap));
-  delete m;
 }
 
 MOSDMap *OSDMonitor::build_incremental(epoch_t from)
@@ -707,7 +709,6 @@ void OSDMonitor::send_incremental(PaxosServiceMessage *req, epoch_t from)
          << " to " << req->get_orig_source_inst() << dendl;
   MOSDMap *m = build_incremental(from);
   mon->send_reply(req, m);
-  delete req;
 }
 
 
index b8053fc6c37b61310e3ede3f18c35c09dc43471c..77b3543c77dd96a10a3e9ec66ccf28c52686153e 100644 (file)
@@ -266,13 +266,12 @@ bool PGMonitor::preprocess_pg_stats(MPGStats *stats)
 {
   int from = stats->get_orig_source().num();
 
-  /*
   // first, just see if they need a new osdmap.  but 
   // only if they've had the map for a while.
   if (stats->had_map_for > 30.0 && 
+      mon->osdmon()->paxos->is_readable() &&
       stats->epoch < mon->osdmon()->osdmap.get_epoch())
-    mon->osdmon()->send_latest(stats->get_orig_source_inst(), stats->epoch+1);
-  */
+    mon->osdmon()->send_latest(stats, stats->epoch+1);
 
   // any new osd or pg info?
   if (pg_map.osd_stat.count(from) ||