Skip to content

Commit

Permalink
osd_types::is_new_interval: size change triggers new interval
Browse files Browse the repository at this point in the history
Fixes: 11771
Signed-off-by: Samuel Just <sjust@redhat.com>
  • Loading branch information
athanatos committed May 26, 2015
1 parent bf0bdbc commit ff79959
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/osd/osd_types.cc
Expand Up @@ -2545,6 +2545,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,
Expand All @@ -2555,6 +2557,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);
}

Expand All @@ -2579,6 +2582,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()),
Expand Down
2 changes: 2 additions & 0 deletions src/osd/osd_types.h
Expand Up @@ -1846,6 +1846,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,
Expand Down
4 changes: 4 additions & 0 deletions src/osdc/Objecter.cc
Expand Up @@ -2458,6 +2458,7 @@ 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;
Expand All @@ -2473,6 +2474,8 @@ 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,
Expand All @@ -2499,6 +2502,7 @@ 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;
ldout(cct, 10) << __func__ << " "
Expand Down
2 changes: 2 additions & 0 deletions src/osdc/Objecter.h
Expand Up @@ -1126,6 +1126,7 @@ class Objecter : public md_config_obs_t, public Dispatcher {
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;
Expand All @@ -1141,6 +1142,7 @@ class Objecter : public md_config_obs_t, public Dispatcher {
pg_num(0),
up_primary(-1),
acting_primary(-1),
size(-1),
min_size(-1),
used_replica(false),
paused(false),
Expand Down

0 comments on commit ff79959

Please sign in to comment.