]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: share random osd map from update_from_paxos, not committed()
authorSage Weil <sage@newdream.net>
Fri, 18 Nov 2011 17:56:10 +0000 (09:56 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 19 Nov 2011 22:30:31 +0000 (14:30 -0800)
This will let us remove committed() entirely.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h

index eef90a2b85c953a0ba65911b5a552c419e5ce5ec..c71d502d17f5faf67186d67fd6f269a74db73207 100644 (file)
@@ -142,7 +142,9 @@ bool OSDMonitor::update_from_paxos()
 
   send_to_waiting();
   check_subs();
-   
+
+  share_map_with_random_osd();
+
   return true;
 }
 
@@ -295,16 +297,17 @@ void OSDMonitor::encode_pending(bufferlist &bl)
 
 
 void OSDMonitor::committed()
+{
+}
+
+void OSDMonitor::share_map_with_random_osd()
 {
   // tell any osd
-  int r = osdmap.get_any_up_osd();
-  if (r >= 0) {
-    MonSession *s = mon->session_map.get_random_osd_session();
-    if (s) {
-      dout(10) << "committed, telling random " << s->inst << " all about it" << dendl;
-      MOSDMap *m = build_incremental(osdmap.get_epoch() - 1, osdmap.get_epoch());  // whatev, they'll request more if they need it
-      mon->messenger->send_message(m, s->inst);
-    }
+  MonSession *s = mon->session_map.get_random_osd_session();
+  if (s) {
+    dout(10) << "committed, telling random " << s->inst << " all about it" << dendl;
+    MOSDMap *m = build_incremental(osdmap.get_epoch() - 1, osdmap.get_epoch());  // whatev, they'll request more if they need it
+    mon->messenger->send_message(m, s->inst);
   }
 }
 
index 6ba34e1ec86847c467368d822adf94da49010120..c7d17459f11c61da09539b308d17a76cc06d0a30 100644 (file)
@@ -58,6 +58,7 @@ private:
   void encode_pending(bufferlist &bl);
 
   void committed();
+  void share_map_with_random_osd();
 
   void handle_query(PaxosServiceMessage *m);
   bool preprocess_query(PaxosServiceMessage *m);  // true if processed.