]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: assert on CEPH_FEATURE_MON_STATEFUL_SUB
authorKefu Chai <kchai@redhat.com>
Tue, 24 Jan 2017 04:49:01 +0000 (12:49 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 27 Jan 2017 04:17:38 +0000 (12:17 +0800)
this feature was introduced in jewel. and we are targeting luminous in
master. so it's safe to assume that all OSDs in the cluster have this
feature.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/PGMonitor.cc

index d32dcf0d19c8a8a41244e098c9295a4fc83705c1..e8490299077a9dc6f84281607c37eb46c9b0b592 100644 (file)
@@ -931,37 +931,13 @@ void PGMonitor::check_osd_map(epoch_t epoch)
 
 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();
-  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);
-  }
+  assert(osdmap.get_up_osd_features() & CEPH_FEATURE_MON_STATEFUL_SUB);
+  check_subs();
+  return;
 }
 
 epoch_t PGMonitor::send_pg_creates(int osd, Connection *con, epoch_t next)