]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/: add MSG_OSD_PG_(BACKFILL|BACKFILL_REMOVE|SCAN) as recovery messages
authorSamuel Just <sjust@redhat.com>
Thu, 6 Apr 2023 05:57:48 +0000 (22:57 -0700)
committerSridhar Seshasayee <sseshasa@redhat.com>
Mon, 8 May 2023 10:52:00 +0000 (16:22 +0530)
Otherwise, these end up as PGOpItem and therefore as immediate:

class PGOpItem : public PGOpQueueable {
...
  op_scheduler_class get_scheduler_class() const final {
    auto type = op->get_req()->get_type();
    if (type == CEPH_MSG_OSD_OP ||
  type == CEPH_MSG_OSD_BACKOFF) {
      return op_scheduler_class::client;
    } else {
      return op_scheduler_class::immediate;
    }
  }
...
};

This was probably causing a bunch of extra interference with client
ops.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PrimaryLogPG.cc
src/osd/scheduler/OpSchedulerItem.h

index aab3c05adceacdaef2c06fbb5e8154e0ca90bc01..7d3a73cf42beb51d2d9dd640a2d53f883246ff46 100644 (file)
@@ -13883,6 +13883,12 @@ uint64_t PrimaryLogPG::recover_backfill(
          MOSDPGScan::OP_SCAN_GET_DIGEST, pg_whoami, e, get_last_peering_reset(),
          spg_t(info.pgid.pgid, bt.shard),
          pbi.end, hobject_t());
+
+       if (cct->_conf->osd_op_queue == "mclock_scheduler") {
+         /* This guard preserves legacy WeightedPriorityQueue behavior for
+          * now, but should be removed after Reef */
+         m->set_priority(recovery_state.get_recovery_op_priority());
+       }
        osd->send_message_osd_cluster(bt.osd, m, get_osdmap_epoch());
        ceph_assert(waiting_on_backfill.find(bt) == waiting_on_backfill.end());
        waiting_on_backfill.insert(bt);
@@ -14050,6 +14056,11 @@ uint64_t PrimaryLogPG::recover_backfill(
       m = reqs[peer] = new MOSDPGBackfillRemove(
        spg_t(info.pgid.pgid, peer.shard),
        get_osdmap_epoch());
+      if (cct->_conf->osd_op_queue == "mclock_scheduler") {
+       /* This guard preserves legacy WeightedPriorityQueue behavior for
+          * now, but should be removed after Reef */
+       m->set_priority(recovery_state.get_recovery_op_priority());
+      }
     }
     m->ls.push_back(make_pair(oid, v));
 
@@ -14134,6 +14145,13 @@ uint64_t PrimaryLogPG::recover_backfill(
       }
       m->last_backfill = pinfo.last_backfill;
       m->stats = pinfo.stats;
+
+      if (cct->_conf->osd_op_queue == "mclock_scheduler") {
+       /* This guard preserves legacy WeightedPriorityQueue behavior for
+        * now, but should be removed after Reef */
+       m->set_priority(recovery_state.get_recovery_op_priority());
+      }
+
       osd->send_message_osd_cluster(bt.osd, m, get_osdmap_epoch());
       dout(10) << " peer " << bt
               << " num_objects now " << pinfo.stats.stats.sum.num_objects
index d8339353bfb906d69d3db04c1ea35b1ce74b6935..00389c4b637c4e9f9668c1cb51eaee987aa7d008 100644 (file)
@@ -577,6 +577,9 @@ public:
     case MSG_OSD_PG_PUSH:
     case MSG_OSD_PG_PUSH_REPLY:
     case MSG_OSD_PG_PULL:
+    case MSG_OSD_PG_BACKFILL:
+    case MSG_OSD_PG_BACKFILL_REMOVE:
+    case MSG_OSD_PG_SCAN:
       return true;
     default:
       return false;