From: Sage Weil Date: Tue, 18 Oct 2011 00:51:53 +0000 (-0700) Subject: osd: do not short-cut up_thru update for new PGs X-Git-Tag: v0.38~57^2~41 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bbb06d34927b44ba44fe680ffb4e6a03cc4a71de;p=ceph.git osd: do not short-cut up_thru update for new PGs Commit e731885d2550ee985bf875ab5bb5faf28f1693eb made it possible for a new PG to go active without forcing the OSDs up_thru to update. This was motivated by the desire for PG creation by radosgw to go faster. Radosgw no longer creates a pool per bucket, so this is not useful there, and it is unclear what other application (that is not abusing rados pools) would need it. Since it complicates the prior set calculation for dubious reasons, let's revert it. Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index cf37a6e82935..4d7b708e8cfa 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -950,9 +950,8 @@ void PG::generate_past_intervals() i.acting.swap(tacting); if (i.acting.size()) { i.maybe_went_rw = - (lastmap->get_up_thru(i.acting[0]) >= first_epoch && - lastmap->get_up_from(i.acting[0]) <= first_epoch) || - (first_epoch == info.history.epoch_created); + lastmap->get_up_thru(i.acting[0]) >= first_epoch && + lastmap->get_up_from(i.acting[0]) <= first_epoch; dout(10) << "generate_past_intervals " << i << " : primary up " << lastmap->get_up_from(i.acting[0]) << "-" << lastmap->get_up_thru(i.acting[0]) @@ -1187,10 +1186,7 @@ void PG::build_prior(std::auto_ptr &prior_set) state_set(PG_STATE_DOWN); } - // NOTE: we can skip the up_thru check if this is a new PG and there - // were no prior intervals. - if (info.history.epoch_created < info.history.same_interval_since && - osd->osdmap->get_up_thru(osd->whoami) < info.history.same_interval_since) { + if (osd->osdmap->get_up_thru(osd->whoami) < info.history.same_interval_since) { dout(10) << "up_thru " << osd->osdmap->get_up_thru(osd->whoami) << " < same_since " << info.history.same_interval_since << ", must notify monitor" << dendl; @@ -3581,10 +3577,9 @@ void PG::start_peering_interval(const OSDMap *lastmap, } if (i.acting.size()) { - i.maybe_went_rw = - (lastmap->get_up_thru(i.acting[0]) >= i.first && - lastmap->get_up_from(i.acting[0]) <= i.first) || - i.first == info.history.epoch_created; + i.maybe_went_rw = + lastmap->get_up_thru(i.acting[0]) >= i.first && + lastmap->get_up_from(i.acting[0]) <= i.first; } else { i.maybe_went_rw = 0; }