]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: send pg_stat with correct seq 36406/head
authorKefu Chai <kchai@redhat.com>
Sat, 1 Aug 2020 16:28:36 +0000 (00:28 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 1 Aug 2020 16:35:58 +0000 (00:35 +0800)
* set the osd_stat in pg_stat message sent to mgr, otherwise the seq id
  in the message would be always 0.
* return the seq id composed of up_epoch and osd_stat_seq when serving
  "flush_pg_stats" tell command.

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

index 0677825f15dbeb2fbdaa1f9563443bf95051438f..87409c242f7c993808894d9791806f132a454c74 100644 (file)
@@ -704,7 +704,7 @@ MessageRef OSD::get_stats() const
   // todo: m-to-n: collect stats using map-reduce
   // MPGStats::had_map_for is not used since PGMonitor was removed
   auto m = make_message<MPGStats>(monc->get_fsid(), osdmap->get_epoch());
-
+  m->osd_stat = osd_stat;
   for (auto [pgid, pg] : pg_map.get_pgs()) {
     if (pg->is_primary()) {
       auto stats = pg->get_stats();
@@ -720,7 +720,7 @@ uint64_t OSD::send_pg_stats()
 {
   // mgr client sends the report message in background
   mgrc->report();
-  return osd_stat_seq;
+  return osd_stat.seq;
 }
 
 OSD::cached_map_t OSD::get_map() const