]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: stop sending pgstat if luminous
authorKefu Chai <kchai@redhat.com>
Tue, 16 May 2017 05:52:51 +0000 (13:52 +0800)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:02:09 +0000 (13:02 -0400)
we don't send pgstat to mon from osd once we set
CEPH_OSDMAP_REQUIRE_LUMINOUS. and cleanup the pgstat queue when we
do the switch.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mgr/MgrClient.cc
src/mgr/MgrClient.h
src/osd/OSD.cc
src/osd/PG.cc

index 45d2707af25d2c46de21a9380dc1e3080a0f9f8b..d096c9ccf3f37b439243861a559a05bdf4313973 100644 (file)
@@ -259,9 +259,13 @@ void MgrClient::send_report()
     timer.add_event_after(stats_period, report_callback);
   }
 
+  send_pgstats();
+}
+
+void MgrClient::send_pgstats()
+{
   if (pgstats_cb) {
-    MPGStats *m_stats = pgstats_cb();
-    session->con->send_message(m_stats);
+    session->con->send_message(pgstats_cb());
   }
 }
 
index f9385b8be6df53dad221dd043580ebe555d3c9fc..87df28650a2d7cc753d5351568ada304c35dae94 100644 (file)
@@ -92,6 +92,7 @@ public:
   bool handle_command_reply(MCommandReply *m);
 
   void send_report();
+  void send_pgstats();
 
   void set_pgstats_cb(std::function<MPGStats*()> cb_)
   {
index 46f55df1bf5141e686c0afa7cb5a175cb7320c3c..66516646eb1864c930270e2e4f1462bef0d8e5c1 100644 (file)
@@ -5023,7 +5023,9 @@ void OSD::tick_without_osd_lock()
       // do any pending reports
       send_full_update();
       send_failures();
-      send_pg_stats(now);
+      if (osdmap->require_osd_release < CEPH_RELEASE_LUMINOUS) {
+       send_pg_stats(now);
+      }
     }
     map_lock.put_read();
   }
@@ -5413,7 +5415,9 @@ void OSD::ms_handle_connect(Connection *con)
       service.send_pg_temp();
       requeue_failures();
       send_failures();
-      send_pg_stats(now);
+      if (osdmap->require_osd_release < CEPH_RELEASE_LUMINOUS) {
+       send_pg_stats(now);
+      }
 
       map_lock.put_read();
       if (is_active()) {
@@ -5854,6 +5858,7 @@ void OSD::send_still_alive(epoch_t epoch, const entity_inst_t &i)
 void OSD::send_pg_stats(const utime_t &now)
 {
   assert(map_lock.is_locked());
+  assert(osdmap->require_osd_release < CEPH_RELEASE_LUMINOUS);
   dout(20) << "send_pg_stats" << dendl;
 
   osd_stat_t cur_stat = service.get_osd_stat();
@@ -6454,7 +6459,11 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector<string>& cmd, buffe
   }
 
   else if (prefix == "flush_pg_stats") {
-    flush_pg_stats();
+    if (osdmap->require_osd_release >= CEPH_RELEASE_LUMINOUS) {
+      mgrc.send_pgstats();
+    } else {
+      flush_pg_stats();
+    }
   }
 
   else if (prefix == "heap") {
@@ -7568,6 +7577,13 @@ void OSD::_committed_osd_maps(epoch_t first, epoch_t last, MOSDMap *m)
        do_restart = true;
       }
     }
+    if (osdmap->require_osd_release < CEPH_RELEASE_LUMINOUS &&
+       newmap->require_osd_release >= CEPH_RELEASE_LUMINOUS) {
+      dout(10) << __func__ << " require_osd_release reached luminous in "
+              << newmap->get_epoch() << dendl;
+      clear_pg_stat_queue();
+      outstanding_pg_stats.clear();
+    }
 
     osdmap = newmap;
     epoch_t up_epoch;
index 8789d34ce8d654ef1a6096b2670a30aa74ce6ef4..994cb9095ff267020b1fadc8c395b44fcaa99f54 100644 (file)
@@ -2714,7 +2714,10 @@ void PG::publish_stats_to_osd()
     if ((info.stats.state & PG_STATE_UNDERSIZED) == 0)
       info.stats.last_fullsized = now;
 
-    publish = true;
+    // do not send pgstat to mon anymore once we are luminous, since mgr takes
+    // care of this by sending MMonMgrReport to mon.
+    publish =
+      osd->osd->get_osdmap()->require_osd_release < CEPH_RELEASE_LUMINOUS;
     pg_stats_publish_valid = true;
     pg_stats_publish = pre_publish;