From ba5c5f3f15844bd51a6c924870b2cfe5fe0d6dd2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 16 May 2017 15:26:41 +0800 Subject: [PATCH] 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 --- src/mon/PGStatService.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mon/PGStatService.h b/src/mon/PGStatService.h index b607af70bf97f..cc6c00f43a792 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(); } -- 2.39.5