share_pg_log(old_last_update);
}
-void PG::build_prior(std::auto_ptr<PgPriorSet> &prior_set)
+void PG::build_prior(std::auto_ptr<PriorSet> &prior_set)
{
if (1) {
// sanity check
assert(info.history.last_epoch_started >= it->second.history.last_epoch_started);
}
}
- prior_set.reset(new PgPriorSet(*osd->osdmap,
+ prior_set.reset(new PriorSet(*osd->osdmap,
past_intervals,
up,
acting,
info,
this));
- PgPriorSet &prior(*prior_set.get());
+ PriorSet &prior(*prior_set.get());
if (prior.crashed) {
state_set(PG_STATE_CRASHED);
return true;
}
-bool PG::choose_log_location(const PgPriorSet &prior_set,
+bool PG::choose_log_location(const PriorSet &prior_set,
bool &need_backlog,
bool &wait_on_backlog,
int &pull_from,
}
std::ostream& operator<<(std::ostream& oss,
- const struct PG::PgPriorSet &prior)
+ const struct PG::PriorSet &prior)
{
- oss << "PgPriorSet[probe=" << prior.probe << " "
+ oss << "PriorSet[probe=" << prior.probe << " "
<< "down=" << prior.down << " "
<< "blocked_by=" << prior.blocked_by << "]";
return oss;
PG *pg = context< RecoveryMachine >().pg;
pg->generate_past_intervals();
- auto_ptr<PgPriorSet> &prior_set = context< Peering >().prior_set;
+ auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
if (!prior_set.get())
pg->build_prior(prior_set);
void PG::RecoveryState::GetInfo::get_infos()
{
PG *pg = context< RecoveryMachine >().pg;
- auto_ptr<PgPriorSet> &prior_set = context< Peering >().prior_set;
+ auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
for (set<int>::const_iterator it = prior_set->probe.begin();
it != prior_set->probe.end();
epoch_t old_start = pg->info.history.last_epoch_started;
if (pg->proc_replica_info(infoevt.from, infoevt.info)) {
// we got something new ...
- auto_ptr<PgPriorSet> &prior_set = context< Peering >().prior_set;
+ auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
if (old_start < pg->info.history.last_epoch_started) {
dout(10) << " last_epoch_started moved forward, rebuilding prior" << dendl;
pg->build_prior(prior_set);
/*---------------------------------------------------*/
#undef dout_prefix
-#define dout_prefix (*_dout << (debug_pg ? debug_pg->gen_prefix() : string()) << " PgPriorSet: ")
+#define dout_prefix (*_dout << (debug_pg ? debug_pg->gen_prefix() : string()) << " PriorSet: ")
-PG::PgPriorSet::PgPriorSet(const OSDMap &osdmap,
+PG::PriorSet::PriorSet(const OSDMap &osdmap,
const map<epoch_t, Interval> &past_intervals,
const vector<int> &up,
const vector<int> &acting,
}
// true if the given map affects the prior set
-bool PG::PgPriorSet::affected_by_map(const OSDMap *osdmap, PG *debug_pg) const
+bool PG::PriorSet::affected_by_map(const OSDMap *osdmap, PG *debug_pg) const
{
for (set<int>::iterator p = probe.begin();
p != probe.end();
protected:
bool prior_set_built;
- struct PgPriorSet {
+ struct PriorSet {
set<int> probe; /// current+prior OSDs we need to probe.
set<int> down; /// down osds that would normally be in @probe and might be interesting.
map<int,epoch_t> 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.
bool pg_down; /// some down osds are included in @cur; the DOWN pg state bit should be set.
- PgPriorSet(const OSDMap &osdmap,
+ PriorSet(const OSDMap &osdmap,
const map<epoch_t, Interval> &past_intervals,
const vector<int> &up,
const vector<int> &acting,
};
friend std::ostream& operator<<(std::ostream& oss,
- const struct PgPriorSet &prior);
+ const struct PriorSet &prior);
public:
struct RecoveryCtx {
struct Active;
struct Peering : boost::statechart::state< Peering, Primary, GetInfo >, NamedState {
- std::auto_ptr< PgPriorSet > prior_set;
+ std::auto_ptr< PriorSet > prior_set;
Peering(my_context ctx);
void exit();
void generate_past_intervals();
void trim_past_intervals();
- void build_prior(std::auto_ptr<PgPriorSet> &prior_set);
+ void build_prior(std::auto_ptr<PriorSet> &prior_set);
void clear_prior();
bool adjust_need_up_thru(const OSDMap *osdmap);
void do_peer(ObjectStore::Transaction& t, list<Context*>& tfin,
map< int, map<pg_t,Query> >& query_map,
map<int, MOSDPGInfo*> *activator_map=0);
- bool choose_log_location(const PgPriorSet &prior_set,
+ bool choose_log_location(const PriorSet &prior_set,
bool &need_backlog,
bool &wait_on_backlog,
int &pull_from,