Skip to content

Commit

Permalink
Merge pull request #5691 from jdurgin/wip-10399-hammer
Browse files Browse the repository at this point in the history
is_new_interval() fixes

Reviewed-by: Samuel Just <sjust@redhat.com>
  • Loading branch information
jdurgin committed Aug 28, 2015
2 parents 41a245a + bee8666 commit ed162d4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
5 changes: 5 additions & 0 deletions src/osd/osd_types.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2547,6 +2547,8 @@ bool pg_interval_t::is_new_interval(
int new_up_primary, int new_up_primary,
const vector<int> &old_up, const vector<int> &old_up,
const vector<int> &new_up, const vector<int> &new_up,
int old_size,
int new_size,
int old_min_size, int old_min_size,
int new_min_size, int new_min_size,
unsigned old_pg_num, unsigned old_pg_num,
Expand All @@ -2557,6 +2559,7 @@ bool pg_interval_t::is_new_interval(
old_up_primary != new_up_primary || old_up_primary != new_up_primary ||
new_up != old_up || new_up != old_up ||
old_min_size != new_min_size || 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);
} }


Expand All @@ -2581,6 +2584,8 @@ bool pg_interval_t::is_new_interval(
new_up_primary, new_up_primary,
old_up, old_up,
new_up, new_up,
lastmap->get_pools().find(pgid.pool())->second.size,
osdmap->get_pools().find(pgid.pool())->second.size,
lastmap->get_pools().find(pgid.pool())->second.min_size, lastmap->get_pools().find(pgid.pool())->second.min_size,
osdmap->get_pools().find(pgid.pool())->second.min_size, osdmap->get_pools().find(pgid.pool())->second.min_size,
lastmap->get_pg_num(pgid.pool()), lastmap->get_pg_num(pgid.pool()),
Expand Down
2 changes: 2 additions & 0 deletions src/osd/osd_types.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1845,6 +1845,8 @@ struct pg_interval_t {
int new_up_primary, int new_up_primary,
const vector<int> &old_up, const vector<int> &old_up,
const vector<int> &new_up, const vector<int> &new_up,
int old_size,
int new_size,
int old_min_size, int old_min_size,
int new_min_size, int new_min_size,
unsigned old_pg_num, unsigned old_pg_num,
Expand Down
8 changes: 7 additions & 1 deletion src/osdc/Objecter.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2428,12 +2428,14 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend, bool any
} }
} }


int size = pi->size;
int min_size = pi->min_size; int min_size = pi->min_size;
unsigned pg_num = pi->get_pg_num(); unsigned pg_num = pi->get_pg_num();
int up_primary, acting_primary; int up_primary, acting_primary;
vector<int> up, acting; vector<int> up, acting;
osdmap->pg_to_up_acting_osds(pgid, &up, &up_primary, osdmap->pg_to_up_acting_osds(pgid, &up, &up_primary,
&acting, &acting_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( if (any_change && pg_interval_t::is_new_interval(
t->acting_primary, t->acting_primary,
acting_primary, acting_primary,
Expand All @@ -2443,11 +2445,13 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend, bool any
up_primary, up_primary,
t->up, t->up,
up, up,
t->size,
size,
t->min_size, t->min_size,
min_size, min_size,
t->pg_num, t->pg_num,
pg_num, pg_num,
pi->raw_pg_to_pg(pgid))) { pg_t(prev_seed, pgid.pool(), pgid.preferred()))) {
force_resend = true; force_resend = true;
} }


Expand All @@ -2469,8 +2473,10 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend, bool any
t->acting_primary = acting_primary; t->acting_primary = acting_primary;
t->up_primary = up_primary; t->up_primary = up_primary;
t->up = up; t->up = up;
t->size = size;
t->min_size = min_size; t->min_size = min_size;
t->pg_num = pg_num; t->pg_num = pg_num;
t->pg_num_mask = pi->get_pg_num_mask();
ldout(cct, 10) << __func__ << " " ldout(cct, 10) << __func__ << " "
<< " pgid " << pgid << " acting " << acting << dendl; << " pgid " << pgid << " acting " << acting << dendl;
t->used_replica = false; t->used_replica = false;
Expand Down
24 changes: 14 additions & 10 deletions src/osdc/Objecter.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1113,16 +1113,18 @@ class Objecter : public md_config_obs_t, public Dispatcher {
object_t target_oid; object_t target_oid;
object_locator_t target_oloc; object_locator_t target_oloc;


bool precalc_pgid; ///< true if we are directed at base_pgid, not base_oid 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 base_pgid; ///< explciti pg target, if any


pg_t pgid; ///< last pg we mapped to pg_t pgid; ///< last pg we mapped to
unsigned pg_num; ///< last pg_num we mapped to unsigned pg_num; ///< last pg_num we mapped to
vector<int> up; ///< set of up osds for last pg we mapped to unsigned pg_num_mask; ///< last pg_num_mask we mapped to
vector<int> acting; ///< set of acting osds for last pg we mapped to vector<int> up; ///< set of up osds for last pg we mapped to
int up_primary; ///< primary for last pg we mapped to based on the up set vector<int> acting; ///< set of acting osds for last pg we mapped to
int acting_primary; ///< primary for last pg we mapped to based on the acting set int up_primary; ///< primary for last pg we mapped to based on the up set
int min_size; ///< the min size of the pool when were were last mapped 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 used_replica;
bool paused; bool paused;
Expand All @@ -1135,8 +1137,10 @@ class Objecter : public md_config_obs_t, public Dispatcher {
base_oloc(oloc), base_oloc(oloc),
precalc_pgid(false), precalc_pgid(false),
pg_num(0), pg_num(0),
pg_num_mask(0),
up_primary(-1), up_primary(-1),
acting_primary(-1), acting_primary(-1),
size(-1),
min_size(-1), min_size(-1),
used_replica(false), used_replica(false),
paused(false), paused(false),
Expand Down

0 comments on commit ed162d4

Please sign in to comment.