Skip to content

Commit

Permalink
osd: Pass oldest_map when generating past intervals
Browse files Browse the repository at this point in the history
From load_pgs() the superblock hasn't been published yet
so we need to retrieve the value of oldest_map depending on the context.

Fixes: #10427

Signed-off-by: David Zafman <dzafman@redhat.com>
  • Loading branch information
dzafman committed Jan 15, 2015
1 parent b9a0484 commit 7fb721c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2887,7 +2887,7 @@ void OSD::build_past_intervals_parallel()
{
map<PG*,pistate> pis;

// calculate untion of map range
// calculate junction of map range
epoch_t end_epoch = superblock.oldest_map;
epoch_t cur_epoch = superblock.newest_map;
{
Expand All @@ -2898,7 +2898,7 @@ void OSD::build_past_intervals_parallel()
PG *pg = i->second;

epoch_t start, end;
if (!pg->_calc_past_interval_range(&start, &end))
if (!pg->_calc_past_interval_range(&start, &end, superblock.oldest_map))
continue;

dout(10) << pg->info.pgid << " needs " << start << "-" << end << dendl;
Expand Down
7 changes: 4 additions & 3 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ bool PG::needs_backfill() const
return ret;
}

bool PG::_calc_past_interval_range(epoch_t *start, epoch_t *end)
bool PG::_calc_past_interval_range(epoch_t *start, epoch_t *end, epoch_t oldest_map)
{
*end = info.history.same_interval_since;

Expand All @@ -642,7 +642,7 @@ bool PG::_calc_past_interval_range(epoch_t *start, epoch_t *end)

*start = MAX(MAX(info.history.epoch_created,
info.history.last_epoch_clean),
osd->get_superblock().oldest_map);
oldest_map);
if (*start >= *end) {
dout(10) << __func__ << " start epoch " << *start << " >= end epoch " << *end
<< ", nothing to do" << dendl;
Expand All @@ -656,7 +656,8 @@ bool PG::_calc_past_interval_range(epoch_t *start, epoch_t *end)
void PG::generate_past_intervals()
{
epoch_t cur_epoch, end_epoch;
if (!_calc_past_interval_range(&cur_epoch, &end_epoch)) {
if (!_calc_past_interval_range(&cur_epoch, &end_epoch,
osd->get_superblock().oldest_map)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/osd/PG.h
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ class PG {

void mark_clean(); ///< mark an active pg clean

bool _calc_past_interval_range(epoch_t *start, epoch_t *end);
bool _calc_past_interval_range(epoch_t *start, epoch_t *end, epoch_t oldest_map);
void generate_past_intervals();
void trim_past_intervals();
void build_prior(std::auto_ptr<PriorSet> &prior_set);
Expand Down

0 comments on commit 7fb721c

Please sign in to comment.