diff options
author | Sage Weil <sage@inktank.com> | 2012-11-28 16:08:04 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-11-29 12:39:43 -0800 |
commit | bd03234c31dab0860683f94fbc7f50f5daf82a0d (patch) | |
tree | f7ace7ebc293fa116c959282f0c8daaf3231a633 | |
parent | e16533029e659aeaae1b0cc32ea3fbc8da334b0c (diff) | |
download | ceph-bd03234c31dab0860683f94fbc7f50f5daf82a0d.tar.gz |
osd: simplify active_committed
Way back in 4b3bb5ab37a05fa001d59f24da7d9c30d650321b we changed this to
pass an entity_inst_t down to fix a race. The refactor of the PG map
handling made this unnecessary; remove it. The PG's OSDMap is not coherent
with respect to the PG when we take the lock, which is all that is
needed here.
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/osd/PG.cc | 14 | ||||
-rw-r--r-- | src/osd/PG.h | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 53e9ae4bb19..77935ea2d7b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1343,11 +1343,10 @@ void PG::build_might_have_unfound() struct C_PG_ActivateCommitted : public Context { PG *pg; epoch_t epoch; - entity_inst_t primary; - C_PG_ActivateCommitted(PG *p, epoch_t e, const entity_inst_t &pi) - : pg(p), epoch(e), primary(pi) {} + C_PG_ActivateCommitted(PG *p, epoch_t e) + : pg(p), epoch(e) {} void finish(int r) { - pg->_activate_committed(epoch, primary); + pg->_activate_committed(epoch); } }; @@ -1409,8 +1408,7 @@ void PG::activate(ObjectStore::Transaction& t, // find out when we commit get(); // for callback - tfin.push_back(new C_PG_ActivateCommitted(this, query_epoch, - get_osdmap()->get_cluster_inst(acting[0]))); + tfin.push_back(new C_PG_ActivateCommitted(this, query_epoch)); // initialize snap_trimq if (is_primary()) { @@ -1729,7 +1727,7 @@ void PG::replay_queued_ops() update_stats(); } -void PG::_activate_committed(epoch_t e, entity_inst_t& primary) +void PG::_activate_committed(epoch_t e) { lock(); if (e < last_peering_reset) { @@ -1749,7 +1747,7 @@ void PG::_activate_committed(epoch_t e, entity_inst_t& primary) info); i.info.history.last_epoch_started = e; m->pg_list.push_back(make_pair(i, pg_interval_map_t())); - osd->cluster_messenger->send_message(m, primary); + osd->cluster_messenger->send_message(m, get_osdmap()->get_cluster_inst(acting[0])); } if (dirty_info) { diff --git a/src/osd/PG.h b/src/osd/PG.h index 292d8c02d9b..b9693fb072a 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -757,7 +757,7 @@ public: list<Context*>& tfin, map< int, map<pg_t,pg_query_t> >& query_map, map<int, vector<pair<pg_notify_t, pg_interval_map_t> > > *activator_map=0); - void _activate_committed(epoch_t e, entity_inst_t& primary); + void _activate_committed(epoch_t e); void all_activated_and_committed(); void proc_primary_info(ObjectStore::Transaction &t, const pg_info_t &info); |