From: Kefu Chai Date: Tue, 16 May 2017 05:52:51 +0000 (+0800) Subject: osd: stop sending pgstat if luminous X-Git-Tag: ses5-milestone6~8^2~19^2~92 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b306e9e0ac1b7f885295f4302709eec5b020fc4f;p=ceph.git osd: stop sending pgstat if luminous 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 --- diff --git a/src/mgr/MgrClient.cc b/src/mgr/MgrClient.cc index 45d2707af25d..d096c9ccf3f3 100644 --- a/src/mgr/MgrClient.cc +++ b/src/mgr/MgrClient.cc @@ -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()); } } diff --git a/src/mgr/MgrClient.h b/src/mgr/MgrClient.h index f9385b8be6df..87df28650a2d 100644 --- a/src/mgr/MgrClient.h +++ b/src/mgr/MgrClient.h @@ -92,6 +92,7 @@ public: bool handle_command_reply(MCommandReply *m); void send_report(); + void send_pgstats(); void set_pgstats_cb(std::function cb_) { diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 46f55df1bf51..66516646eb18 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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& 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; diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 8789d34ce8d6..994cb9095ff2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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;