From 949b148dbac8041812e3db07b7e27ada70a980ee Mon Sep 17 00:00:00 2001 From: David Zafman Date: Fri, 19 Jun 2015 14:02:15 -0700 Subject: [PATCH] osd: CEPH_FEATURE_INDEP_PG_MAP feature now required Feature present since at least the Dumpling release. A later commit will add it to the osd_required mask Signed-off-by: David Zafman --- src/osd/OSD.cc | 105 ++++++------------------------------------------- src/osd/OSD.h | 1 - 2 files changed, 13 insertions(+), 93 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 4b6a7d69a0b24..9068034ee3f03 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7092,37 +7092,6 @@ void OSD::dispatch_context_transaction(PG::RecoveryCtx &ctx, PG *pg, } } -bool OSD::compat_must_dispatch_immediately(PG *pg) -{ - assert(pg->is_locked()); - set tmpacting; - if (!pg->actingbackfill.empty()) { - tmpacting = pg->actingbackfill; - } else { - for (unsigned i = 0; i < pg->acting.size(); ++i) { - if (pg->acting[i] == CRUSH_ITEM_NONE) - continue; - tmpacting.insert( - pg_shard_t( - pg->acting[i], - pg->pool.info.ec_pool() ? shard_id_t(i) : shard_id_t::NO_SHARD)); - } - } - - for (set::iterator i = tmpacting.begin(); - i != tmpacting.end(); - ++i) { - if (i->osd == whoami || i->osd == CRUSH_ITEM_NONE) - continue; - ConnectionRef conn = - service.get_con_osd_cluster(i->osd, pg->get_osdmap()->get_epoch()); - if (conn && !conn->has_feature(CEPH_FEATURE_INDEP_PG_MAP)) { - return true; - } - } - return false; -} - void OSD::dispatch_context(PG::RecoveryCtx &ctx, PG *pg, OSDMapRef curmap, ThreadPool::TPHandle *handle) { @@ -7177,26 +7146,11 @@ void OSD::do_notifies( continue; } service.share_map_peer(it->first, con.get(), curmap); - if (con->has_feature(CEPH_FEATURE_INDEP_PG_MAP)) { - dout(7) << __func__ << " osd " << it->first - << " on " << it->second.size() << " PGs" << dendl; - MOSDPGNotify *m = new MOSDPGNotify(curmap->get_epoch(), - it->second); - con->send_message(m); - } else { - dout(7) << __func__ << " osd " << it->first - << " sending separate messages" << dendl; - for (vector >::iterator i = - it->second.begin(); - i != it->second.end(); - ++i) { - vector > list(1); - list[0] = *i; - MOSDPGNotify *m = new MOSDPGNotify(i->first.epoch_sent, - list); - con->send_message(m); - } - } + dout(7) << __func__ << " osd " << it->first + << " on " << it->second.size() << " PGs" << dendl; + MOSDPGNotify *m = new MOSDPGNotify(curmap->get_epoch(), + it->second); + con->send_message(m); } } @@ -7222,24 +7176,10 @@ void OSD::do_queries(map >& query_map, continue; } service.share_map_peer(who, con.get(), curmap); - if (con->has_feature(CEPH_FEATURE_INDEP_PG_MAP)) { - dout(7) << __func__ << " querying osd." << who - << " on " << pit->second.size() << " PGs" << dendl; - MOSDPGQuery *m = new MOSDPGQuery(curmap->get_epoch(), pit->second); - con->send_message(m); - } else { - dout(7) << __func__ << " querying osd." << who - << " sending seperate messages on " << pit->second.size() - << " PGs" << dendl; - for (map::iterator i = pit->second.begin(); - i != pit->second.end(); - ++i) { - map to_send; - to_send.insert(*i); - MOSDPGQuery *m = new MOSDPGQuery(i->second.epoch_sent, to_send); - con->send_message(m); - } - } + dout(7) << __func__ << " querying osd." << who + << " on " << pit->second.size() << " PGs" << dendl; + MOSDPGQuery *m = new MOSDPGQuery(curmap->get_epoch(), pit->second); + con->send_message(m); } } @@ -7271,22 +7211,9 @@ void OSD::do_infos(mapfirst, con.get(), curmap); - if (con->has_feature(CEPH_FEATURE_INDEP_PG_MAP)) { - MOSDPGInfo *m = new MOSDPGInfo(curmap->get_epoch()); - m->pg_list = p->second; - con->send_message(m); - } else { - for (vector >::iterator i = - p->second.begin(); - i != p->second.end(); - ++i) { - vector > to_send(1); - to_send[0] = *i; - MOSDPGInfo *m = new MOSDPGInfo(i->first.epoch_sent); - m->pg_list = to_send; - con->send_message(m); - } - } + MOSDPGInfo *m = new MOSDPGInfo(curmap->get_epoch()); + m->pg_list = p->second; + con->send_message(m); } info_map.clear(); } @@ -8472,13 +8399,7 @@ void OSD::process_peering_events( rctx.on_applied->add(new C_CompleteSplits(this, split_pgs)); split_pgs.clear(); } - if (compat_must_dispatch_immediately(pg)) { - dispatch_context(rctx, pg, curmap, &handle); - rctx = create_context(); - rctx.handle = &handle; - } else { - dispatch_context_transaction(rctx, pg, &handle); - } + dispatch_context_transaction(rctx, pg, &handle); pg->unlock(); handle.reset_tp_timeout(); } diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 85452057ca380..b861120b43bcc 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -2021,7 +2021,6 @@ protected: // -- generic pg peering -- PG::RecoveryCtx create_context(); - bool compat_must_dispatch_immediately(PG *pg); void dispatch_context(PG::RecoveryCtx &ctx, PG *pg, OSDMapRef curmap, ThreadPool::TPHandle *handle = NULL); void dispatch_context_transaction(PG::RecoveryCtx &ctx, PG *pg, -- 2.39.5