]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not short-cut up_thru update for new PGs
authorSage Weil <sage@newdream.net>
Tue, 18 Oct 2011 00:51:53 +0000 (17:51 -0700)
committerSage Weil <sage@newdream.net>
Tue, 18 Oct 2011 00:51:53 +0000 (17:51 -0700)
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 <sage@newdream.net>
src/osd/PG.cc

index cf37a6e829350dce72365b74717900125a9626b5..4d7b708e8cfa8855aaed224f7789e842ce732c9b 100644 (file)
@@ -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<PgPriorSet> &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;
     }