From: Kefu Chai Date: Tue, 16 May 2017 07:26:41 +0000 (+0800) Subject: mon/PGStatService: define maybe_trim_creating_pgs() method X-Git-Tag: ses5-milestone6~8^2~19^2~90 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ba5c5f3f15844bd51a6c924870b2cfe5fe0d6dd2;p=ceph.git mon/PGStatService: define maybe_trim_creating_pgs() method 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 --- diff --git a/src/mon/PGStatService.h b/src/mon/PGStatService.h index b607af70bf9..cc6c00f43a7 100644 --- a/src/mon/PGStatService.h +++ b/src/mon/PGStatService.h @@ -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 *get_osd_stat() const = 0; - virtual const ceph::unordered_map *get_pg_stat() const { - ceph_abort(); - } + virtual const ceph::unordered_map& 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(); }