struct C_PG_ActivateCommitted : public Context {
PG *pg;
epoch_t epoch;
- C_PG_ActivateCommitted(PG *p, epoch_t e) : pg(p), epoch(e) {}
+ entity_inst_t primary;
+ C_PG_ActivateCommitted(PG *p, epoch_t e, entity_inst_t pi) : pg(p), epoch(e), primary(pi) {}
void finish(int r) {
- pg->_activate_committed(epoch);
+ pg->_activate_committed(epoch, primary);
}
};
// find out when we commit
get(); // for callback
- tfin.push_back(new C_PG_ActivateCommitted(this, info.history.same_interval_since));
+ tfin.push_back(new C_PG_ActivateCommitted(this, info.history.same_interval_since,
+ get_osdmap()->get_inst(acting[0])));
// initialize snap_trimq
if (is_primary()) {
update_stats();
}
-void PG::_activate_committed(epoch_t e)
+void PG::_activate_committed(epoch_t e, entity_inst_t& primary)
{
lock();
if (e < last_peering_reset) {
all_activated_and_committed();
} else {
dout(10) << "_activate_committed " << e << " telling primary" << dendl;
- epoch_t cur_epoch = get_osdmap()->get_epoch();
- entity_inst_t primary = get_osdmap()->get_cluster_inst(acting[0]);
- MOSDPGInfo *m = new MOSDPGInfo(cur_epoch);
+ MOSDPGInfo *m = new MOSDPGInfo(e);
pg_info_t i = info;
i.history.last_epoch_started = e;
m->pg_info.push_back(i);
void activate(ObjectStore::Transaction& t, list<Context*>& tfin,
map< int, map<pg_t,pg_query_t> >& query_map,
map<int, MOSDPGInfo*> *activator_map=0);
- void _activate_committed(epoch_t e);
+ void _activate_committed(epoch_t e, entity_inst_t& primary);
void all_activated_and_committed();
void proc_primary_info(ObjectStore::Transaction &t, const pg_info_t &info);