]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG::peer: introduce prior_set_build flag
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 22 Oct 2010 18:01:15 +0000 (11:01 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 22 Oct 2010 18:01:15 +0000 (11:01 -0700)
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 <colinm@hq.newdream.net>
src/osd/PG.cc
src/osd/PG.h

index 80a8b67e26b1c19989b57d770d87901eceaf01a8..d2bf8b0d3e7770a626e5e11e8d86ceb0df60b2df 100644 (file)
@@ -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<Context*>& 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;
index d7eeeef97d3c0ad589699ff7547c7dde32c29389..9f148a72a02a4cdf18196a26faf5fa0844e63d07 100644 (file)
@@ -781,10 +781,12 @@ public:
   // [primary only] content recovery state
   bool        have_master_log;
  protected:
+  bool prior_set_built;
   set<int>    prior_set;   // current+prior OSDs, as defined by info.history.last_epoch_started.
   set<int>    prior_set_down;     // down osds normally exluded from prior_set
   map<int,epoch_t> prior_set_up_thru;  // osds whose up_thru we care about
   set<int>    prior_set_lost;  // osds in the prior set which are lost
+
   bool        need_up_thru;
   set<int>    stray_set;   // non-acting osds that have PG data.
   set<int>    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),