]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Add dump_scrub_reservations to show scrub reserve tracking
authorDavid Zafman <dzafman@redhat.com>
Tue, 30 Jul 2019 20:43:05 +0000 (20:43 +0000)
committerDavid Zafman <dzafman@redhat.com>
Tue, 10 Sep 2019 20:32:29 +0000 (13:32 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
PendingReleaseNotes
src/osd/OSD.cc
src/osd/OSD.h

index 5e2660d52dc7218f066125d7d5b85598d081cef2..d793483a08d1c2959c208f27621b57fc7f5bf8c9 100644 (file)
 
 * New OSD daemon command dump_recovery_reservations which reveals the
   recovery locks held (in_progress) and waiting in priority queues.
+
+* New OSD daemon command dump_scrub_reservations which reveals the
+  scrub reservations that are active and pending.
index 74d84654c3f3cc3591df43c2e4eb915dd81dc32b..14e2c064816ce13bd7ecdeb379e83fc9679762a2 100644 (file)
@@ -1263,6 +1263,14 @@ void OSDService::dec_scrubs_active()
   ceph_assert(scrubs_active >= 0);
 }
 
+void OSDService::dump_scrub_reservations(Formatter *f)
+{
+  std::lock_guard l{sched_scrub_lock};
+  f->dump_int("scrubs_active", scrubs_active);
+  f->dump_int("scrubs_pending", scrubs_pending);
+  f->dump_int("osd_max_scrubs", cct->_conf->osd_max_scrubs);
+}
+
 void OSDService::retrieve_epochs(epoch_t *_boot_epoch, epoch_t *_up_epoch,
                                  epoch_t *_bind_epoch) const
 {
@@ -2459,6 +2467,10 @@ will start to track new ops received afterwards.";
     service.remote_reserver.dump(f);
     f->close_section();
     f->close_section();
+  } else if (admin_command == "dump_scrub_reservations") {
+    f->open_object_section("scrub_reservations");
+    service.dump_scrub_reservations(f);
+    f->close_section();
   } else if (admin_command == "get_latest_osdmap") {
     get_latest_osdmap();
   } else if (admin_command == "heap") {
@@ -3324,6 +3336,10 @@ void OSD::final_init()
                                     asok_hook,
                                     "show recovery reservations");
   ceph_assert(r == 0);
+  r = admin_socket->register_command("dump_scrub_reservations", "dump_scrub_reservations",
+                                    asok_hook,
+                                    "show scrub reservations");
+  ceph_assert(r == 0);
   r = admin_socket->register_command("get_latest_osdmap", "get_latest_osdmap",
                                     asok_hook,
                                     "force osd to update the latest map from "
index 73455e91bd8e611d423bae9af876eb9fb86dc697..770087970b34a870a50dacbfae5c1377911b498a 100644 (file)
@@ -354,6 +354,7 @@ public:
   void inc_scrubs_active(bool reserved);
   void dec_scrubs_pending();
   void dec_scrubs_active();
+  void dump_scrub_reservations(Formatter *f);
 
   void reply_op_error(OpRequestRef op, int err);
   void reply_op_error(OpRequestRef op, int err, eversion_t v, version_t uv);