From: Jason Dillaman Date: Fri, 21 Aug 2015 15:32:39 +0000 (-0400) Subject: Objecter: pg_interval_t::is_new_interval needs pgid from previous pool X-Git-Tag: v0.94.4~82^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bee86660377cfaa74f7ed668dd02492f25553ff9;p=ceph.git Objecter: pg_interval_t::is_new_interval needs pgid from previous pool When increasing the pg_num of a pool, an assert would fail since the calculated pgid seed would be for the pool's new pg_num value instead of the previous pg_num value. Fixes: #10399 Backport: infernalis, hammer, firefly Signed-off-by: Jason Dillaman (cherry picked from commit f20f7a23e913d09cc7fc22fb3df07f9938ddc144) Conflicts: (hobject_t sort order not backported, trivial resolution) src/osdc/Objecter.cc src/osdc/Objecter.h --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index eb0c24b0c4230..856425af9553a 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2435,6 +2435,7 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend, bool any vector up, acting; osdmap->pg_to_up_acting_osds(pgid, &up, &up_primary, &acting, &acting_primary); + unsigned prev_seed = ceph_stable_mod(pgid.ps(), t->pg_num, t->pg_num_mask); if (any_change && pg_interval_t::is_new_interval( t->acting_primary, acting_primary, @@ -2450,7 +2451,7 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend, bool any min_size, t->pg_num, pg_num, - pi->raw_pg_to_pg(pgid))) { + pg_t(prev_seed, pgid.pool(), pgid.preferred()))) { force_resend = true; } @@ -2475,6 +2476,7 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend, bool any t->size = size; t->min_size = min_size; t->pg_num = pg_num; + t->pg_num_mask = pi->get_pg_num_mask(); ldout(cct, 10) << __func__ << " " << " pgid " << pgid << " acting " << acting << dendl; t->used_replica = false; diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 08bfcfce2f652..0aac5e95a4e8d 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1113,17 +1113,18 @@ public: object_t target_oid; object_locator_t target_oloc; - bool precalc_pgid; ///< true if we are directed at base_pgid, not base_oid - pg_t base_pgid; ///< explciti pg target, if any - - pg_t pgid; ///< last pg we mapped to - unsigned pg_num; ///< last pg_num we mapped to - vector up; ///< set of up osds for last pg we mapped to - vector acting; ///< set of acting osds for last pg we mapped to - int up_primary; ///< primary for last pg we mapped to based on the up set - int acting_primary; ///< primary for last pg we mapped to based on the acting set - int size; ///< the size of the pool when were were last mapped - int min_size; ///< the min size of the pool when were were last mapped + bool precalc_pgid; ///< true if we are directed at base_pgid, not base_oid + pg_t base_pgid; ///< explciti pg target, if any + + pg_t pgid; ///< last pg we mapped to + unsigned pg_num; ///< last pg_num we mapped to + unsigned pg_num_mask; ///< last pg_num_mask we mapped to + vector up; ///< set of up osds for last pg we mapped to + vector acting; ///< set of acting osds for last pg we mapped to + int up_primary; ///< primary for last pg we mapped to based on the up set + int acting_primary; ///< primary for last pg we mapped to based on the acting set + int size; ///< the size of the pool when were were last mapped + int min_size; ///< the min size of the pool when were were last mapped bool used_replica; bool paused; @@ -1136,6 +1137,7 @@ public: base_oloc(oloc), precalc_pgid(false), pg_num(0), + pg_num_mask(0), up_primary(-1), acting_primary(-1), size(-1),