]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
messages,osd: remove MPGStats::had_map_for 27026/head
authorKefu Chai <kchai@redhat.com>
Mon, 18 Mar 2019 05:42:46 +0000 (13:42 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 19 Mar 2019 06:46:30 +0000 (14:46 +0800)
MPGStats::had_map_for was added back in 7844d0e5, the last release that
still checks this field was mimic -- monitor sends OSD incremental
osdmaps if the monitor finds that the pg_stats' had_map_for is greater
than 30 and the epoch is less than that of latest osdmap.

but DaemonServer as the new consumer of MPGStats does not check
had_map_for anymore -- it simply updates the cluster state with the
pg_stats reported by OSD. and we directs OSD to mgr for sending pg_stats
since mimic. so, we can safely drop the support of had_map_for in
octopus, as it has been 2 releases.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/messages/MPGStats.h
src/osd/OSD.cc
src/osd/OSD.h
src/test/mon/test_mon_workloadgen.cc

index ca907a48aa0feace20f71c4aae393a15e2103223..4bf7afda5c5c2f70e609e252d2772c77807cf185 100644 (file)
@@ -29,14 +29,12 @@ public:
   osd_stat_t osd_stat;
   map<int64_t, store_statfs_t> pool_stat;
   epoch_t epoch = 0;
-  utime_t had_map_for;
   
   MPGStats() : MessageInstance(MSG_PGSTATS, 0, HEAD_VERSION, COMPAT_VERSION) {}
-  MPGStats(const uuid_d& f, epoch_t e, utime_t had)
+  MPGStats(const uuid_d& f, epoch_t e)
     : MessageInstance(MSG_PGSTATS, 0, HEAD_VERSION, COMPAT_VERSION),
       fsid(f),
-      epoch(e),
-      had_map_for(had)
+      epoch(e)
   {}
 
 private:
@@ -55,7 +53,7 @@ public:
     encode(osd_stat, payload, features);
     encode(pg_stat, payload);
     encode(epoch, payload);
-    encode(had_map_for, payload);
+    encode(utime_t{}, payload);
     encode(pool_stat, payload, features);
   }
   void decode_payload() override {
@@ -65,7 +63,8 @@ public:
     decode(osd_stat, p);
     decode(pg_stat, p);
     decode(epoch, p);
-    decode(had_map_for, p);
+    utime_t dummy;
+    decode(dummy, p);
     if (header.version >= 2)
       decode(pool_stat, p);
   }
index 25425dd80874d2492be6da30b013f18d5ec5b04a..fb40671d71e4e91a5c79c07fb9ce7cd008d7cbe9 100644 (file)
@@ -7628,11 +7628,10 @@ MPGStats* OSD::collect_pg_stats()
   // their stats are always enqueued for sending.
   RWLock::RLocker l(map_lock);
 
-  utime_t had_for = ceph_clock_now() - had_map_since;
   osd_stat_t cur_stat = service.get_osd_stat();
   cur_stat.os_perf_stat = store->get_cur_stats();
 
-  auto m = new MPGStats(monc->get_fsid(), osdmap->get_epoch(), had_for);
+  auto m = new MPGStats(monc->get_fsid(), osdmap->get_epoch());
   m->osd_stat = cur_stat;
 
   std::lock_guard lec{min_last_epoch_clean_lock};
@@ -8208,8 +8207,6 @@ void OSD::_committed_osd_maps(epoch_t first, epoch_t last, MOSDMap *m)
     }
   }
 
-  had_map_since = ceph_clock_now();
-
   epoch_t _bind_epoch = service.get_bind_epoch();
   if (osdmap->is_up(whoami) &&
       osdmap->get_addrs(whoami).legacy_equals(
index 68c00f4fc0a89d9c05df2a7db961b6b6e84de545..12ceefc9f5f0db0c61f2dd5d1616a4432799d228 100644 (file)
@@ -1855,7 +1855,6 @@ protected:
 
   pool_pg_num_history_t pg_num_history;
 
-  utime_t         had_map_since;
   RWLock          map_lock;
   list<OpRequestRef>  waiting_for_osdmap;
   deque<utime_t> osd_markdown_log;
index 666342c979e7b10b6e898214ad35ed8d0f950965..70b23dd3a9357988b51026845b0708a408b899a6 100644 (file)
@@ -537,8 +537,7 @@ class OSDStub : public TestStub
   void send_pg_stats() {
     dout(10) << __func__
             << " pgs " << pgs.size() << " osdmap " << osdmap << dendl;
-    utime_t now = ceph_clock_now();
-    MPGStats *mstats = new MPGStats(monc.get_fsid(), osdmap.get_epoch(), now);
+    MPGStats *mstats = new MPGStats(monc.get_fsid(), osdmap.get_epoch());
 
     mstats->set_tid(1);
     mstats->osd_stat = osd_stat;