* hasn't changed since the given epoch and we are the primary.
*/
PG *OSD::get_or_create_pg(const pg_info_t& info, pg_interval_map_t& pi,
- epoch_t epoch, int from, int& created, bool primary,
- ObjectStore::Transaction **pt,
- C_Contexts **pfin)
+ epoch_t epoch, int from, int& created, bool primary)
{
PG *pg;
ObjectStore::Transaction *t = 0;
// ok, create PG locally using provided Info and History
t = new ObjectStore::Transaction;
fin = new C_Contexts(g_ceph_context);
- pg = _create_lock_pg(info.pgid, create, false, role, up, acting, history, pi, **pt);
+ map< int, vector<pair<pg_info_t, pg_interval_map_t> > > notify_list; // primary -> list
+ map< int, map<pg_t,pg_query_t> > query_map; // peer -> PG -> get_summary_since
+ map<int,MOSDPGInfo*> info_map; // peer -> message
+ PG::RecoveryCtx rctx(&query_map, &info_map, ¬ify_list, &fin->contexts, t);
+ pg = _create_lock_pg(info.pgid, create, false, role, up, acting, history, pi, *t);
+ pg->handle_create(&rctx);
+ do_notifies(notify_list, osdmap->get_epoch());
+ do_queries(query_map);
+ do_infos(info_map);
created++;
dout(10) << *pg << " is new" << dendl;
t = new ObjectStore::Transaction;
fin = new C_Contexts(g_ceph_context);
}
- if (pt) {
- assert(pfin);
- *pt = t;
- *pfin = fin;
- } else if (t && t->empty()) {
+ if (t && t->empty()) {
delete t;
delete fin;
- } else {
+ } else if (t) {
int tr = store->queue_transaction(
&pg->osr,
t, new ObjectStore::C_DeleteTransaction(t), fin);
op->mark_started();
- // look for unknown PGs i'm primary for
- map< int, map<pg_t,pg_query_t> > query_map;
- map<int, MOSDPGInfo*> info_map;
- int created = 0;
-
- for (vector<pair<pg_info_t,pg_interval_map_t> >::iterator it = m->get_pg_list().begin();
+ for (vector<pair<pg_notify_t, pg_interval_map_t> >::iterator it = m->get_pg_list().begin();
it != m->get_pg_list().end();
it++) {
PG *pg = 0;
void exit();
typedef boost::mpl::list <
- boost::statechart::transition< Initialize, Started >,
+ boost::statechart::transition< Initialize, Reset >,
boost::statechart::transition< Load, Reset >,
boost::statechart::custom_reaction< MNotifyRec >,
boost::statechart::custom_reaction< MInfoRec >,