]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGStatService: define maybe_trim_creating_pgs() method
authorKefu Chai <kchai@redhat.com>
Tue, 16 May 2017 07:26:41 +0000 (15:26 +0800)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:02:10 +0000 (13:02 -0400)
replace get_pg_stat() with maybe_trim_creating_pgs(), so it is more
symmetric: maybe_add_creating_pgs() versus maybe_trim_creating_pgs().
and we don't need to return a pointer which is always valid. a const
reference is a better fit in this case.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/PGStatService.h

index b607af70bf97f7449c02614615f599d0f48626a2..cc6c00f43a7924db80ab9c3b6da1f1d82f0d2b0e 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef CEPH_PGSTATSERVICE_H
 #define CEPH_PGSTATSERVICE_H
 
-#include "mon/PGMap.h"
 struct creating_pgs_t;
 
 class PGStatService {
@@ -43,10 +42,7 @@ public:
   virtual const osd_stat_t& get_osd_sum() const = 0;
 
   virtual const osd_stat_t *get_osd_stat(int osd) const = 0;
-  virtual const ceph::unordered_map<int32_t,osd_stat_t> *get_osd_stat() const = 0;
-  virtual const ceph::unordered_map<pg_t,pg_stat_t> *get_pg_stat() const {
-    ceph_abort();
-  }
+  virtual const ceph::unordered_map<int32_t,osd_stat_t>& get_osd_stat() const = 0;
   virtual float get_full_ratio() const {
     ceph_abort();
   }
@@ -67,6 +63,14 @@ public:
                                      creating_pgs_t *pending_creates) const {
     ceph_abort();
   }
+  /**
+   * For upgrades. If some PGs are created before all OSDs are luminous
+   * and start sending MOSDPGCreated, we need to be sync with pgmap
+   *
+   */
+  virtual void maybe_trim_creating_pgs(creating_pgs_t *creates) const {
+    ceph_abort();
+  }
   virtual epoch_t get_min_last_epoch_clean() const {
     ceph_abort();
   }