]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: use reply_request in pgmon pg stats update
authorSage Weil <sage@newdream.net>
Fri, 9 Oct 2009 23:43:49 +0000 (16:43 -0700)
committerSage Weil <sage@newdream.net>
Fri, 9 Oct 2009 23:43:49 +0000 (16:43 -0700)
src/TODO
src/mon/PGMonitor.cc
src/mon/PGMonitor.h

index 2fef139c3f8b57af20ab5fae71642cee55f75951..6226afa523053b0e5a1c7219783c65ada498c754 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -44,8 +44,6 @@ v0.17
 - kclient: retry alloc on ENOMEM when reading from connection?
 
 - kill mon->osd
-  - MRoute breaks if we bounce between multiple monitors
-  - monitor may drop our request if cluster changes, but session doesn't reset
   - kill shutdown msg
 - kill mon->mds
   - beacon reply
index 528d9b2ecee114511b810aab07480389a504d4f4..9df03f25610816e88e545861e177a8aaa5bb4c19 100644 (file)
@@ -377,15 +377,15 @@ bool PGMonitor::prepare_pg_stats(MPGStats *stats)
     */
   }
   
-  paxos->wait_for_commit(new C_Stats(this, ack, stats->get_orig_source_inst()));
-  delete stats;
+  paxos->wait_for_commit(new C_Stats(this, stats, ack));
   return true;
 }
 
-void PGMonitor::_updated_stats(MPGStatsAck *ack, entity_inst_t who)
+void PGMonitor::_updated_stats(MPGStats *req, MPGStatsAck *ack)
 {
-  dout(7) << "_updated_stats for " << who << dendl;
-  mon->messenger->send_message(ack, who);
+  dout(7) << "_updated_stats for " << req->get_orig_source_inst() << dendl;
+  mon->send_reply(req, ack);
+  delete req;
 }
 
 
index de44d5602130891c906d2c9a2fc3e32e90066c8c..9e0584ee3c1d6096cd5dbe25adbb8a8da7e9dc82 100644 (file)
@@ -55,15 +55,16 @@ private:
 
   bool preprocess_pg_stats(MPGStats *stats);
   bool prepare_pg_stats(MPGStats *stats);
-  void _updated_stats(MPGStatsAck *ack, entity_inst_t who);
+  void _updated_stats(MPGStats *req, MPGStatsAck *ack);
 
   struct C_Stats : public Context {
     PGMonitor *pgmon;
+    MPGStats *req;
     MPGStatsAck *ack;
     entity_inst_t who;
-    C_Stats(PGMonitor *p, MPGStatsAck *a, entity_inst_t w) : pgmon(p), ack(a), who(w) {}
+    C_Stats(PGMonitor *p, MPGStats *r, MPGStatsAck *a) : pgmon(p), req(r), ack(a) {}
     void finish(int r) {
-      pgmon->_updated_stats(ack, who);
+      pgmon->_updated_stats(req, ack);
     }    
   };