From: Sridhar Seshasayee Date: Mon, 7 Sep 2020 19:16:16 +0000 (+0530) Subject: osd: Use PGRecoveryMsg class to enqueue recovery specific operations. X-Git-Tag: v16.1.0~1127^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37031%2Fhead;p=ceph.git osd: Use PGRecoveryMsg class to enqueue recovery specific operations. Enqueue recovery specific ops received via MOSDPGPush or MOSDPGPushReply messages as PGRecoveryMsg OpSchedulerItem. Fixes: https://tracker.ceph.com/issues/47344 Signed-off-by: Sridhar Seshasayee --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index eff4759417f5..3b6eb37cd68b 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -9614,8 +9614,10 @@ void OSD::enqueue_op(spg_t pg, OpRequestRef&& op, epoch_t epoch) const unsigned priority = op->get_req()->get_priority(); const int cost = op->get_req()->get_cost(); const uint64_t owner = op->get_req()->get_source().num(); + const int type = op->get_req()->get_type(); dout(15) << "enqueue_op " << op << " prio " << priority + << " type " << type << " cost " << cost << " latency " << latency << " epoch " << epoch @@ -9625,10 +9627,18 @@ void OSD::enqueue_op(spg_t pg, OpRequestRef&& op, epoch_t epoch) op->osd_trace.keyval("cost", cost); op->mark_queued_for_pg(); logger->tinc(l_osd_op_before_queue_op_lat, latency); - op_shardedwq.queue( - OpSchedulerItem( - unique_ptr(new PGOpItem(pg, std::move(op))), - cost, priority, stamp, owner, epoch)); + if (type == MSG_OSD_PG_PUSH || + type == MSG_OSD_PG_PUSH_REPLY) { + op_shardedwq.queue( + OpSchedulerItem( + unique_ptr(new PGRecoveryMsg(pg, std::move(op))), + cost, priority, stamp, owner, epoch)); + } else { + op_shardedwq.queue( + OpSchedulerItem( + unique_ptr(new PGOpItem(pg, std::move(op))), + cost, priority, stamp, owner, epoch)); + } } void OSD::enqueue_peering_evt(spg_t pgid, PGPeeringEventRef evt) diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 5ebb54eb35b3..dc25f604c35a 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1565,6 +1565,7 @@ protected: friend class ceph::osd::scheduler::PGOpItem; friend class ceph::osd::scheduler::PGPeeringItem; friend class ceph::osd::scheduler::PGRecovery; + friend class ceph::osd::scheduler::PGRecoveryMsg; friend class ceph::osd::scheduler::PGDelete; class ShardedOpWQ