From da6cdfdd2753ba93d8b08a433ef161cf54562603 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 18 Oct 2011 11:42:16 -0700 Subject: [PATCH] osd: PgPriorSet: cur -> probe Rename cur to probe, the set of OSDs we need to probe in order to successfully peer. Signed-off-by: Sage Weil --- src/osd/PG.cc | 24 +++++++++++++----------- src/osd/PG.h | 4 ++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 401c191c23f60..42cdf41f31553 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -985,8 +985,8 @@ void PG::trim_past_intervals() // true if the given map affects the prior set bool PG::prior_set_affected(PgPriorSet &prior, const OSDMap *osdmap) const { - for (set::iterator p = prior.cur.begin(); - p != prior.cur.end(); + for (set::iterator p = prior.probe.begin(); + p != prior.probe.end(); ++p) { int o = *p; @@ -1307,7 +1307,7 @@ bool PG::choose_log_location(const PgPriorSet &prior_set, for (map::const_iterator i = all_info.begin(); i != all_info.end(); ++i) { - if (prior_set.cur.find(i->first) == prior_set.cur.end()) { + if (prior_set.probe.find(i->first) == prior_set.probe.end()) { dout(10) << "osd." << i->first << " not in current prior set, skipping" << dendl; continue; } @@ -3905,7 +3905,7 @@ ostream& operator<<(ostream& out, const PG& pg) std::ostream& operator<<(std::ostream& oss, const struct PG::PgPriorSet &prior) { - oss << "PgPriorSet[cur=" << prior.cur << " " + oss << "PgPriorSet[probe=" << prior.probe << " " << "down=" << prior.down << " " << "blocked_by=" << prior.blocked_by << "]"; return oss; @@ -4424,8 +4424,8 @@ void PG::RecoveryState::GetInfo::get_infos() PG *pg = context< RecoveryMachine >().pg; auto_ptr &prior_set = context< Peering >().prior_set; - for (set::const_iterator it = prior_set->cur.begin(); - it != prior_set->cur.end(); + for (set::const_iterator it = prior_set->probe.begin(); + it != prior_set->probe.end(); ++it) { int peer = *it; if (peer == pg->osd->whoami) { @@ -4882,11 +4882,11 @@ PG::PgPriorSet::PgPriorSet(int whoami, // so that we know what they do/do not have explicitly before // sending them any new info/logs/whatever. for (unsigned i=0; i::const_reverse_iterator p = past_intervals.rbegin(); p != past_intervals.rend(); @@ -4937,7 +4937,7 @@ PG::PgPriorSet::PgPriorSet(int whoami, if (osdmap.is_up(o)) { // include past acting osds if they are up. - cur.insert(o); + probe.insert(o); any_up_now = true; } else if (!pinfo) { dout(10) << "build_prior prior osd." << o << " no longer exists" << dendl; @@ -4965,7 +4965,7 @@ PG::PgPriorSet::PgPriorSet(int whoami, ++i) { if (osdmap.exists(*i) && // if it doesn't exist, we already consider it lost. osdmap.is_down(*i)) { - cur.insert(*i); + probe.insert(*i); pg_down = true; // make note of when any down osd in the cur set was lost, so that @@ -4985,7 +4985,9 @@ PG::PgPriorSet::PgPriorSet(int whoami, } } - dout(10) << "build_prior final: cur " << cur << " down " << down << " blocked_by " << blocked_by + dout(10) << "build_prior final: probe " << probe + << " down " << down + << " blocked_by " << blocked_by << (crashed ? " crashed":"") << (pg_down ? " pg_down":"") << dendl; diff --git a/src/osd/PG.h b/src/osd/PG.h index efcbe864e5134..07b2b8c81079b 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -843,8 +843,8 @@ public: bool prior_set_built; struct PgPriorSet { - set cur; /// current+prior OSDs we need to probe. - set down; /// down osds that would normally be in @cur and might be interesting. + set probe; /// current+prior OSDs we need to probe. + set down; /// down osds that would normally be in @probe and might be interesting. map blocked_by; /// current lost_at values for any OSDs in cur set for which (re)marking them lost would affect cur set bool crashed; /// true if past osd failures were such that clients may need to replay requests. -- 2.39.5