]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Use PGRecoveryMsg class to enqueue recovery specific operations. 37031/head
authorSridhar Seshasayee <sseshasa@redhat.com>
Mon, 7 Sep 2020 19:16:16 +0000 (00:46 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Wed, 9 Sep 2020 13:05:16 +0000 (18:35 +0530)
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 <sseshasa@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index eff4759417f5545f4e9d49f5749671093a8a7cad..3b6eb37cd68b13c64a14a58756f111533dda61cc 100644 (file)
@@ -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<OpSchedulerItem::OpQueueable>(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<OpSchedulerItem::OpQueueable>(new PGRecoveryMsg(pg, std::move(op))),
+        cost, priority, stamp, owner, epoch));
+  } else {
+    op_shardedwq.queue(
+      OpSchedulerItem(
+        unique_ptr<OpSchedulerItem::OpQueueable>(new PGOpItem(pg, std::move(op))),
+        cost, priority, stamp, owner, epoch));
+  }
 }
 
 void OSD::enqueue_peering_evt(spg_t pgid, PGPeeringEventRef evt)
index 5ebb54eb35b3d3127a0f3d310d02ae5778090777..dc25f604c35aaf4b1198e94cecb720d7485a9d28 100644 (file)
@@ -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