]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor: clean up some send_pg_creates cruft
authorSage Weil <sage@redhat.com>
Tue, 31 Jan 2017 17:31:12 +0000 (12:31 -0500)
committerShinobu Kinjo <shinobu@redhat.com>
Fri, 3 Mar 2017 23:24:19 +0000 (08:24 +0900)
ff1fd4b4b69b52ef5ae734115b1d733aad03b03e already removed most of
this; remove the now useless stub and clean up the unneede con
check.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit b79a85e80a1a660c5a5746270edb86d3f09cd983)

Conflicts:
src/mon/PGMonitor.cc

src/mon/PGMonitor.cc
src/mon/PGMonitor.h

index 0941f40b2d0965a08cf1ed7085e76f6be048ede8..0baeb86639b75b0fa45a2d7c00395a40f1233d50 100644 (file)
@@ -286,8 +286,12 @@ void PGMonitor::upgrade_format()
 void PGMonitor::post_paxos_update()
 {
   dout(10) << __func__ << dendl;
-  if (mon->osdmon()->osdmap.get_epoch()) {
-    send_pg_creates();
+  OSDMap& osdmap = mon->osdmon()->osdmap;
+  if (osdmap.get_epoch()) {
+    if (osdmap.get_num_up_osds() > 0) {
+      assert(osdmap.get_up_osd_features() & CEPH_FEATURE_MON_STATEFUL_SUB);
+      check_subs();
+    }
   }
 }
 
@@ -928,41 +932,6 @@ void PGMonitor::check_osd_map(epoch_t epoch)
   propose_pending();
 }
 
-void PGMonitor::send_pg_creates()
-{
-  // We only need to do this old, spammy way of broadcasting create messages
-  // to every osd (even those that aren't connected) if there are old OSDs in
-  // the cluster. As soon as everybody has upgraded we can flipt to the new
-  // behavior instead
-  OSDMap& osdmap = mon->osdmon()->osdmap;
-  if (osdmap.get_num_up_osds() == 0)
-    return;
-
-  if (osdmap.get_up_osd_features() & CEPH_FEATURE_MON_STATEFUL_SUB) {
-    check_subs();
-    return;
-  }
-
-  dout(10) << "send_pg_creates to " << pg_map.creating_pgs.size()
-           << " pgs" << dendl;
-
-  utime_t now = ceph_clock_now(g_ceph_context);
-  for (map<int, map<epoch_t, set<pg_t> > >::iterator p =
-         pg_map.creating_pgs_by_osd_epoch.begin();
-       p != pg_map.creating_pgs_by_osd_epoch.end();
-       ++p) {
-    int osd = p->first;
-
-    // throttle?
-    if (last_sent_pg_create.count(osd) &&
-        now - g_conf->mon_pg_create_interval < last_sent_pg_create[osd])
-      continue;
-
-    if (osdmap.is_up(osd))
-      send_pg_creates(osd, NULL, 0);
-  }
-}
-
 epoch_t PGMonitor::send_pg_creates(int osd, Connection *con, epoch_t next)
 {
   dout(30) << __func__ << " " << pg_map.creating_pgs_by_osd_epoch << dendl;
@@ -1000,13 +969,8 @@ epoch_t PGMonitor::send_pg_creates(int osd, Connection *con, epoch_t next)
     return next;
   }
 
-  if (con) {
-    con->send_message(m);
-  } else {
-    assert(mon->osdmon()->osdmap.is_up(osd));
-    mon->messenger->send_message(m, mon->osdmon()->osdmap.get_inst(osd));
-  }
-  last_sent_pg_create[osd] = ceph_clock_now(g_ceph_context);
+  con->send_message(m);
+  last_sent_pg_create[osd] = ceph_clock_now();
 
   // sub is current through last + 1
   return last + 1;
index 2fce01200b062961f9750bdb031ffa50f25042af..e1c9c822f98f4d2f6c5bd5f621e8b3ce153110a1 100644 (file)
@@ -92,7 +92,6 @@ private:
 
   void register_new_pgs();
 
-  void send_pg_creates();
   epoch_t send_pg_creates(int osd, Connection *con, epoch_t next);
 
   /**