From: Colin Patrick McCabe Date: Fri, 22 Oct 2010 18:01:15 +0000 (-0700) Subject: PG::peer: introduce prior_set_build flag X-Git-Tag: v0.23~120 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf0d347d43c2fe0003e246c8d5482879733d3dc9;p=ceph.git PG::peer: introduce prior_set_build flag Just because we have prior_set.empty() doesn't mean that the prior set wasn't built. Create a flag to represent this concept. Signed-off-by: Colin McCabe --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 80a8b67e26b1..d2bf8b0d3e77 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -832,6 +832,7 @@ void PG::clear_prior() prior_set_down.clear(); prior_set_up_thru.clear(); prior_set_lost.clear(); + prior_set_built = false; } @@ -1043,6 +1044,7 @@ void PG::build_prior() << (is_down() ? " down":"") << (some_down ? " some_down":"") << dendl; + prior_set_built = true; } void PG::clear_primary_state() @@ -1273,7 +1275,7 @@ void PG::peer(ObjectStore::Transaction& t, list& tfin, if (!is_active()) state_set(PG_STATE_PEERING); - if (prior_set.empty()) + if (!prior_set_built) build_prior(); dout(10) << "peer prior_set is " << prior_set << dendl; diff --git a/src/osd/PG.h b/src/osd/PG.h index d7eeeef97d3c..9f148a72a02a 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -781,10 +781,12 @@ public: // [primary only] content recovery state bool have_master_log; protected: + bool prior_set_built; set prior_set; // current+prior OSDs, as defined by info.history.last_epoch_started. set prior_set_down; // down osds normally exluded from prior_set map prior_set_up_thru; // osds whose up_thru we care about set prior_set_lost; // osds in the prior set which are lost + bool need_up_thru; set stray_set; // non-acting osds that have PG data. set uptodate_set; // current OSDs that are uptodate @@ -937,6 +939,7 @@ public: role(0), state(0), have_master_log(true), + prior_set_built(false), need_up_thru(false), pg_stats_lock("PG::pg_stats_lock"), pg_stats_valid(false),