Skip to content
Permalink
Browse files

Merge pull request #5691 from jdurgin/wip-10399-hammer

is_new_interval() fixes

Reviewed-by: Samuel Just <sjust@redhat.com>
  • Loading branch information...
jdurgin committed Aug 28, 2015
2 parents 41a245a + bee8666 commit ed162d498051ac237be33ac6a6764ae0c61d57a6
Showing with 28 additions and 11 deletions.
  1. +5 −0 src/osd/osd_types.cc
  2. +2 −0 src/osd/osd_types.h
  3. +7 −1 src/osdc/Objecter.cc
  4. +14 −10 src/osdc/Objecter.h
@@ -2547,6 +2547,8 @@ bool pg_interval_t::is_new_interval(
int new_up_primary,
const vector<int> &old_up,
const vector<int> &new_up,
int old_size,
int new_size,
int old_min_size,
int new_min_size,
unsigned old_pg_num,
@@ -2557,6 +2559,7 @@ bool pg_interval_t::is_new_interval(
old_up_primary != new_up_primary ||
new_up != old_up ||
old_min_size != new_min_size ||
old_size != new_size ||
pgid.is_split(old_pg_num, new_pg_num, 0);
}

@@ -2581,6 +2584,8 @@ bool pg_interval_t::is_new_interval(
new_up_primary,
old_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,
osdmap->get_pools().find(pgid.pool())->second.min_size,
lastmap->get_pg_num(pgid.pool()),
@@ -1845,6 +1845,8 @@ struct pg_interval_t {
int new_up_primary,
const vector<int> &old_up,
const vector<int> &new_up,
int old_size,
int new_size,
int old_min_size,
int new_min_size,
unsigned old_pg_num,
@@ -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;
unsigned pg_num = pi->get_pg_num();
int up_primary, acting_primary;
vector<int> 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,
@@ -2443,11 +2445,13 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend, bool any
up_primary,
t->up,
up,
t->size,
size,
t->min_size,
min_size,
t->pg_num,
pg_num,
pi->raw_pg_to_pg(pgid))) {
pg_t(prev_seed, pgid.pool(), pgid.preferred()))) {
force_resend = true;
}

@@ -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->up_primary = up_primary;
t->up = up;
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;
@@ -1113,16 +1113,18 @@ class Objecter : public md_config_obs_t, public Dispatcher {
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<int> up; ///< set of up osds for last pg we mapped to
vector<int> 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 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<int> up; ///< set of up osds for last pg we mapped to
vector<int> 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;
@@ -1135,8 +1137,10 @@ class Objecter : public md_config_obs_t, public Dispatcher {
base_oloc(oloc),
precalc_pgid(false),
pg_num(0),
pg_num_mask(0),
up_primary(-1),
acting_primary(-1),
size(-1),
min_size(-1),
used_replica(false),
paused(false),

0 comments on commit ed162d4

Please sign in to comment.
You can’t perform that action at this time.