From: Sage Weil Date: Fri, 19 Apr 2019 19:52:14 +0000 (-0500) Subject: osd/osd_types: take bare const OSDMap * to check_new_interval X-Git-Tag: v15.1.0~2850^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=89ef2b0857bdbc8ed9c1ad20764f809c0f84d6d0;p=ceph-ci.git osd/osd_types: take bare const OSDMap * to check_new_interval Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index d5f6f0872cd..cfd123c0418 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4739,8 +4739,8 @@ void OSD::build_initial_pg_history( up, new_up, h->same_interval_since, h->last_epoch_clean, - osdmap, - lastmap, + osdmap.get(), + lastmap.get(), pgid.pgid, &min_size_predicate, pi, diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 88219371434..2f5273fc5c2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -6123,8 +6123,8 @@ bool PG::should_restart_peering( newupprimary, up, newup, - osdmap, - lastmap, + osdmap.get(), + lastmap.get(), info.pgid.pgid)) { dout(20) << "new interval newup " << newup << " newacting " << newacting << dendl; @@ -6278,8 +6278,8 @@ void PG::start_peering_interval( oldup, newup, info.history.same_interval_since, info.history.last_epoch_clean, - osdmap, - lastmap, + osdmap.get(), + lastmap.get(), info.pgid.pgid, recoverable.get(), &past_intervals, diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index d0b3d8b2758..7540eabe3d0 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -3774,8 +3774,8 @@ bool PastIntervals::is_new_interval( int new_up_primary, const vector &old_up, const vector &new_up, - OSDMapRef osdmap, - OSDMapRef lastmap, + const OSDMap *osdmap, + const OSDMap *lastmap, pg_t pgid) { const pg_pool_t *plast = lastmap->get_pg_pool(pgid.pool()); @@ -3821,8 +3821,8 @@ bool PastIntervals::check_new_interval( const vector &new_up, epoch_t same_interval_since, epoch_t last_epoch_clean, - OSDMapRef osdmap, - OSDMapRef lastmap, + const OSDMap *osdmap, + const OSDMap *lastmap, pg_t pgid, IsPGRecoverablePredicate *could_have_gone_active, PastIntervals *past_intervals, diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 78cf6e8592d..d469cf5bf1b 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -3137,8 +3137,8 @@ public: int new_up_primary, ///< [in] up primary of osdmap const std::vector &old_up, ///< [in] up as of lastmap const std::vector &new_up, ///< [in] up as of osdmap - std::shared_ptr osdmap, ///< [in] current map - std::shared_ptr lastmap, ///< [in] last map + const OSDMap *osdmap, ///< [in] current map + const OSDMap *lastmap, ///< [in] last map pg_t pgid ///< [in] pgid for pg ); @@ -3146,6 +3146,24 @@ public: * Integrates a new map into *past_intervals, returns true * if an interval was closed out. */ + static bool check_new_interval( + int old_acting_primary, ///< [in] primary as of lastmap + int new_acting_primary, ///< [in] primary as of osdmap + const std::vector &old_acting, ///< [in] acting as of lastmap + const std::vector &new_acting, ///< [in] acting as of osdmap + int old_up_primary, ///< [in] up primary of lastmap + int new_up_primary, ///< [in] up primary of osdmap + const std::vector &old_up, ///< [in] up as of lastmap + const std::vector &new_up, ///< [in] up as of osdmap + epoch_t same_interval_since, ///< [in] as of osdmap + epoch_t last_epoch_clean, ///< [in] current + const OSDMap *osdmap, ///< [in] current map + const OSDMap *lastmap, ///< [in] last map + pg_t pgid, ///< [in] pgid for pg + IsPGRecoverablePredicate *could_have_gone_active, ///< [in] predicate whether the pg can be active + PastIntervals *past_intervals, ///< [out] intervals + std::ostream *out = 0 ///< [out] debug ostream + ); static bool check_new_interval( int old_acting_primary, ///< [in] primary as of lastmap int new_acting_primary, ///< [in] primary as of osdmap @@ -3163,7 +3181,19 @@ public: IsPGRecoverablePredicate *could_have_gone_active, ///< [in] predicate whether the pg can be active PastIntervals *past_intervals, ///< [out] intervals std::ostream *out = 0 ///< [out] debug ostream - ); + ) { + return check_new_interval( + old_acting_primary, new_acting_primary, + old_acting, new_acting, + old_up_primary, new_up_primary, + old_up, new_up, + same_interval_since, last_epoch_clean, + osdmap.get(), lastmap.get(), + pgid, + could_have_gone_active, + past_intervals, + out); + } friend std::ostream& operator<<(std::ostream& out, const PastIntervals &i);