From: Sage Weil Date: Fri, 7 Aug 2015 20:03:18 +0000 (-0400) Subject: osd/osd_types: pg_interval_t: a change in sort order triggers a new interval X-Git-Tag: v9.1.0~346^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf49bb3eaff946229b328302fdee712feb009ee3;p=ceph.git osd/osd_types: pg_interval_t: a change in sort order triggers a new interval Signed-off-by: Sage Weil --- diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 3ed3fe60f08b..b256001b345e 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -2646,6 +2646,8 @@ bool pg_interval_t::is_new_interval( int new_min_size, unsigned old_pg_num, unsigned new_pg_num, + bool old_sort_bitwise, + bool new_sort_bitwise, pg_t pgid) { return old_acting_primary != new_acting_primary || new_acting != old_acting || @@ -2653,7 +2655,8 @@ bool pg_interval_t::is_new_interval( new_up != old_up || old_min_size != new_min_size || old_size != new_size || - pgid.is_split(old_pg_num, new_pg_num, 0); + pgid.is_split(old_pg_num, new_pg_num, 0) || + old_sort_bitwise != new_sort_bitwise; } bool pg_interval_t::is_new_interval( @@ -2683,6 +2686,8 @@ bool pg_interval_t::is_new_interval( osdmap->get_pools().find(pgid.pool())->second.min_size, lastmap->get_pg_num(pgid.pool()), osdmap->get_pg_num(pgid.pool()), + lastmap->test_flag(CEPH_OSDMAP_SORTBITWISE), + osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE), pgid); } diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index bfe24ca2fbcc..0c3848bec238 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -1972,6 +1972,8 @@ struct pg_interval_t { int new_min_size, unsigned old_pg_num, unsigned new_pg_num, + bool old_sort_bitwise, + bool new_sort_bitwise, pg_t pgid ); diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index f82f6c7d064a..bc509cc7ab29 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2481,6 +2481,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); + bool sort_bitwise = osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE); if (any_change && pg_interval_t::is_new_interval( t->acting_primary, acting_primary, @@ -2496,6 +2497,8 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend, bool any min_size, t->pg_num, pg_num, + t->sort_bitwise, + sort_bitwise, pi->raw_pg_to_pg(pgid))) { force_resend = true; } @@ -2521,6 +2524,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->sort_bitwise = sort_bitwise; 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 65a3569cc294..d3c0effe90a2 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1128,6 +1128,7 @@ public: 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 sort_bitwise; ///< whether the hobject_t sort order is bitwise bool used_replica; bool paused; @@ -1144,6 +1145,7 @@ public: acting_primary(-1), size(-1), min_size(-1), + sort_bitwise(false), used_replica(false), paused(false), osd(-1)