From: Sage Weil Date: Tue, 23 May 2017 13:49:16 +0000 (-0400) Subject: mgr: apply PGMap incremental at same interval as reports X-Git-Tag: ses5-milestone6~8^2~19^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d6d1db62edeb4c40a774fcb56e7619b2997ff2d0;p=ceph.git mgr: apply PGMap incremental at same interval as reports We were doing an incremental per osd stat report; this screws up the delta stats updates when there are more than a handful of OSDs. Instead, do it with the same period as the mgr->mon reports. Signed-off-by: Sage Weil --- diff --git a/src/mgr/ClusterState.cc b/src/mgr/ClusterState.cc index 127ac06d4dc5..b8d35d30453b 100644 --- a/src/mgr/ClusterState.cc +++ b/src/mgr/ClusterState.cc @@ -49,8 +49,6 @@ void ClusterState::load_digest(MMgrDigest *m) void ClusterState::ingest_pgstats(MPGStats *stats) { Mutex::Locker l(lock); - PGMap::Incremental pending_inc; - pending_inc.version = pg_map.version + 1; // to make apply_incremental happy const int from = stats->get_orig_source().num(); bool is_in = false; @@ -87,7 +85,13 @@ void ClusterState::ingest_pgstats(MPGStats *stats) pending_inc.pg_stat_updates[pgid] = pg_stats; } +} +void ClusterState::update_delta_stats() +{ + pending_inc.stamp = ceph_clock_now(); + pending_inc.version = pg_map.version + 1; // to make apply_incremental happy + dout(10) << " v" << pending_inc.version << dendl; pg_map.apply_incremental(g_ceph_context, pending_inc); } @@ -95,8 +99,9 @@ void ClusterState::notify_osdmap(const OSDMap &osd_map) { Mutex::Locker l(lock); - PGMap::Incremental pending_inc; + pending_inc.stamp = ceph_clock_now(); pending_inc.version = pg_map.version + 1; // to make apply_incremental happy + dout(10) << " v" << pending_inc.version << dendl; PGMapUpdater::check_osd_map(g_ceph_context, osd_map, pg_map, &pending_inc); diff --git a/src/mgr/ClusterState.h b/src/mgr/ClusterState.h index ca7deddaea11..56ed080b8294 100644 --- a/src/mgr/ClusterState.h +++ b/src/mgr/ClusterState.h @@ -39,6 +39,7 @@ protected: mutable Mutex lock; PGMap pg_map; + PGMap::Incremental pending_inc; bufferlist health_json; bufferlist mon_status_json; @@ -48,6 +49,8 @@ public: void load_digest(MMgrDigest *m); void ingest_pgstats(MPGStats *stats); + void update_delta_stats(); + const bufferlist &get_health() const {return health_json;} const bufferlist &get_mon_status() const {return mon_status_json;} diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 07526bae6214..7fe9208ab23b 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -819,6 +819,8 @@ void DaemonServer::send_report() { auto m = new MMonMgrReport(); cluster_state.with_pgmap([&](const PGMap& pg_map) { + cluster_state.update_delta_stats(); + // FIXME: no easy way to get mon features here. this will do for // now, though, as long as we don't make a backward-incompat change. pg_map.encode_digest(m->get_data(), CEPH_FEATURES_ALL);