Skip to content

Commit

Permalink
mon: remove the redundant min_last_epoch_clean judge in PGMap
Browse files Browse the repository at this point in the history
 In the end of the apply_incremental function, no matter what

 happens the min_last_epoch_clean must be 0.

 Signed-off-by:song baisen <song.baisen@zte.com.cn>
  • Loading branch information
yonghengdexin735 committed Jun 22, 2016
1 parent f222afd commit be6f0e1
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/mon/PGMap.cc
Expand Up @@ -206,20 +206,7 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc)
if (t == pg_stat.end()) {
ceph::unordered_map<pg_t,pg_stat_t>::value_type v(update_pg, update_stat);
pg_stat.insert(v);
// did we affect the min?
if (min_last_epoch_clean &&
update_stat.get_effective_last_epoch_clean() < min_last_epoch_clean)
min_last_epoch_clean = 0;
} else {
// did we (or might we) affect the min?
epoch_t lec = update_stat.get_effective_last_epoch_clean();
if (min_last_epoch_clean &&
(lec < min_last_epoch_clean || // we did
(lec > min_last_epoch_clean && // we might
t->second.get_effective_last_epoch_clean() == min_last_epoch_clean)
))
min_last_epoch_clean = 0;

stat_pg_sub(update_pg, t->second);
t->second = update_stat;
}
Expand All @@ -245,14 +232,6 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc)
map<int32_t,epoch_t>::const_iterator j = inc.get_osd_epochs().find(osd);
assert(j != inc.get_osd_epochs().end());

// will we potentially affect the min?
if (min_last_epoch_clean &&
(i == osd_epochs.end() ||
j->second < min_last_epoch_clean ||
(j->second > min_last_epoch_clean &&
i->second == min_last_epoch_clean)))
min_last_epoch_clean = 0;

if (i == osd_epochs.end())
osd_epochs.insert(*j);
else
Expand Down

0 comments on commit be6f0e1

Please sign in to comment.