if (pg->is_active() && pg->have_unfound()) {
// Make sure we've requested MISSING information from every OSD
// we know about.
- map< int, map<pg_t,PG::Query> > query_map;
pg->discover_all_missing(query_map);
- do_queries(query_map);
}
int tr = store->queue_transaction(&pg->osr, t, new ObjectStore::C_DeleteTransaction(t), fin);
PG::Info &info,
PG::Log &log,
PG::Missing *missing,
+ map< int, map<pg_t,PG::Query> >& query_map,
map<int, MOSDPGInfo*>* info_map,
int& created)
{
ObjectStore::Transaction *t = new ObjectStore::Transaction;
C_Contexts *fin = new C_Contexts;
-
+
PG *pg = 0;
if (!_have_pg(info.pgid)) {
vector<int> up, acting;
if (pg->have_unfound()) {
// Make sure we've requested MISSING information from every OSD
// we know about.
- map< int, map<pg_t,PG::Query> > query_map;
pg->discover_all_missing(query_map);
- do_queries(query_map);
}
else {
dout(10) << *pg << " ignoring osd" << from << " log, pg is already active" << dendl;
pg->proc_replica_log(*t, info, log, *missing, from);
// peer
- map< int, map<pg_t,PG::Query> > query_map;
pg->do_peer(*t, fin->contexts, query_map, info_map);
pg->update_stats();
- do_queries(query_map);
}
} else if (!pg->info.dne()) {
if (!pg->is_active()) {
assert(pg->log.tail <= pg->info.last_complete || pg->log.backlog);
assert(pg->log.head == pg->info.last_update);
- pg->activate(*t, fin->contexts, info_map);
+ pg->activate(*t, fin->contexts, query_map, info_map);
} else {
// ACTIVE REPLICA
assert(pg->is_replica());
int created = 0;
if (!require_same_or_newer_map(m, m->get_epoch())) return;
+ map< int, map<pg_t,PG::Query> > query_map;
_process_pg_info(m->get_epoch(), from,
- m->info, m->log, &m->missing, 0,
+ m->info, m->log, &m->missing, query_map, 0,
created);
+ do_queries(query_map);
if (created)
update_heartbeat_peers();
PG::Log empty_log;
map<int,MOSDPGInfo*> info_map;
int created = 0;
+ map< int, map<pg_t,PG::Query> > query_map;
for (vector<PG::Info>::iterator p = m->pg_info.begin();
p != m->pg_info.end();
++p)
- _process_pg_info(m->get_epoch(), from, *p, empty_log, NULL, &info_map, created);
+ _process_pg_info(m->get_epoch(), from, *p, empty_log, NULL, query_map, &info_map, created);
+ do_queries(query_map);
do_infos(info_map);
if (created)
update_heartbeat_peers();
if (!require_same_or_newer_map(m, m->get_epoch()))
return;
+ map< int, map<pg_t,PG::Query> > query_map;
PG::Log empty_log;
int created = 0;
_process_pg_info(m->get_epoch(), from, m->info,
- empty_log, &m->missing, NULL, created);
+ empty_log, &m->missing, query_map, NULL, created);
+ do_queries(query_map);
if (created)
update_heartbeat_peers();
{
assert(osd_lock.is_locked());
+ map< int, map<pg_t,PG::Query> > query_map; // peer -> PG -> get_summary_since
+
if (pg_map.count(pgid)) {
PG *pg = _lookup_lock_pg(pgid);
if (pg->is_crashed() &&
pg->replay_until == activate_at) {
ObjectStore::Transaction *t = new ObjectStore::Transaction;
C_Contexts *fin = new C_Contexts;
- pg->activate(*t, fin->contexts);
+ pg->activate(*t, fin->contexts, query_map);
int tr = store->queue_transaction(&pg->osr, t, new ObjectStore::C_DeleteTransaction(t), fin);
assert(tr == 0);
}
pg->unlock();
}
+ do_queries(query_map);
+
// wake up _all_ pg waiters; raw pg -> actual pg mapping may have shifted
wake_all_pg_waiters();
}
}
else if (!is_active()) {
// -- ok, activate!
- activate(t, tfin, activator_map);
- if (have_unfound())
- discover_all_missing(query_map);
+ activate(t, tfin, query_map, activator_map);
}
else if (is_all_uptodate())
finish_recovery(t, tfin);
}
void PG::activate(ObjectStore::Transaction& t, list<Context*>& tfin,
+ map< int, map<pg_t,Query> >& query_map,
map<int, MOSDPGInfo*> *activator_map)
{
assert(!is_active());
if (is_primary()) {
dout(10) << "activate - starting recovery" << dendl;
osd->queue_for_recovery(this);
+ if (have_unfound())
+ discover_all_missing(query_map);
}
}
}
}
- // discard unneeded peering state
- //peer_log.clear(); // actually, do this carefully, in case peer() is called again.
-
// all clean?
if (is_all_uptodate())
finish_recovery(t, tfin);