diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 19c3ee401be..531e2446753 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -1910,38 +1910,28 @@ void ReplicatedBackend::send_pushes(int prio, map > & get_osdmap()->get_epoch()); if (!con) continue; - if (!(con->get_features() & CEPH_FEATURE_OSD_PACKED_RECOVERY)) { - for (vector::iterator j = i->second.begin(); - j != i->second.end(); + vector::iterator j = i->second.begin(); + while (j != i->second.end()) { + uint64_t cost = 0; + uint64_t pushes = 0; + MOSDPGPush *msg = new MOSDPGPush(); + msg->from = get_parent()->whoami_shard(); + msg->pgid = get_parent()->primary_spg_t(); + msg->map_epoch = get_osdmap()->get_epoch(); + msg->set_priority(prio); + for (; + (j != i->second.end() && + cost < cct->_conf->osd_max_push_cost && + pushes < cct->_conf->osd_max_push_objects) ; ++j) { - dout(20) << __func__ << ": sending push (legacy) " << *j + dout(20) << __func__ << ": sending push " << *j << " to osd." << i->first << dendl; - send_push_op_legacy(prio, i->first, *j); - } - } else { - vector::iterator j = i->second.begin(); - while (j != i->second.end()) { - uint64_t cost = 0; - uint64_t pushes = 0; - MOSDPGPush *msg = new MOSDPGPush(); - msg->from = get_parent()->whoami_shard(); - msg->pgid = get_parent()->primary_spg_t(); - msg->map_epoch = get_osdmap()->get_epoch(); - msg->set_priority(prio); - for (; - (j != i->second.end() && - cost < cct->_conf->osd_max_push_cost && - pushes < cct->_conf->osd_max_push_objects) ; - ++j) { - dout(20) << __func__ << ": sending push " << *j - << " to osd." << i->first << dendl; - cost += j->cost(cct); - pushes += 1; - msg->pushes.push_back(*j); - } - msg->compute_cost(cct); - get_parent()->send_message_osd_cluster(msg, con); + cost += j->cost(cct); + pushes += 1; + msg->pushes.push_back(*j); } + msg->compute_cost(cct); + get_parent()->send_message_osd_cluster(msg, con); } } } @@ -1956,30 +1946,16 @@ void ReplicatedBackend::send_pulls(int prio, map > &p get_osdmap()->get_epoch()); if (!con) continue; - if (!(con->get_features() & CEPH_FEATURE_OSD_PACKED_RECOVERY)) { - for (vector::iterator j = i->second.begin(); - j != i->second.end(); - ++j) { - dout(20) << __func__ << ": sending pull (legacy) " << *j - << " to osd." << i->first << dendl; - send_pull_legacy( - prio, - i->first, - j->recovery_info, - j->recovery_progress); - } - } else { - dout(20) << __func__ << ": sending pulls " << i->second - << " to osd." << i->first << dendl; - MOSDPGPull *msg = new MOSDPGPull(); - msg->from = parent->whoami_shard(); - msg->set_priority(prio); - msg->pgid = get_parent()->primary_spg_t(); - msg->map_epoch = get_osdmap()->get_epoch(); - msg->pulls.swap(i->second); - msg->compute_cost(cct); - get_parent()->send_message_osd_cluster(msg, con); - } + dout(20) << __func__ << ": sending pulls " << i->second + << " to osd." << i->first << dendl; + MOSDPGPull *msg = new MOSDPGPull(); + msg->from = parent->whoami_shard(); + msg->set_priority(prio); + msg->pgid = get_parent()->primary_spg_t(); + msg->map_epoch = get_osdmap()->get_epoch(); + msg->pulls.swap(i->second); + msg->compute_cost(cct); + get_parent()->send_message_osd_cluster(msg, con); } }