]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: operator abort: (not) handling in-the-mail scrubs 66515/head
authorRonen Friedman <rfriedma@redhat.com>
Mon, 8 Dec 2025 15:09:30 +0000 (09:09 -0600)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 20 Jan 2026 16:40:03 +0000 (16:40 +0000)
Fix on_operator_abort_scrub() to handle the case where
the operator-initiated abort request arrives while the
'start scrub' message is still in the queue (i.e. -
is_queued_or_active() is true, but is_scrub_active()
is false).

Unlike our handling of, for example, FullReset in
PrimaryIdle::clear_state(), here we choose to ignore
the request:
Considering the added complexity to the FSM versus
the minimal benefit, it is better to just ignore this
very rare case, leaving it to the operator to re-issue
the abort command if needed.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/pg_scrubber.cc

index 0d58e1546f55337a3f0da9a2a6c59e779c34ba1b..c10494629f9b33058b235f3e0dfb05ea704af8df 100644 (file)
@@ -802,6 +802,19 @@ void PgScrubber::on_operator_abort_scrub(ceph::Formatter* f)
     f->dump_bool("applicable", true);
     f->dump_bool("active", true);
 
+  } else if (is_queued_or_active()) {
+    // instead of adding logic to the FSM to handle this rare
+    // occasion, we will simply ignore it (and let the operators
+    // know they can reissue the command, if still needed).
+    const auto err_text = fmt::format(
+        "{}: pg[{}] scrub not stopped due to transitory state. Reissue!",
+        __func__, m_pg_id.pgid);
+    dout(10) << err_text << dendl;
+
+    f->dump_bool("applicable", false);
+    f->dump_bool("active", true);
+    f->dump_string("error", err_text);
+
   } else if (!m_scrub_job->is_registered()) {
     const auto err_text = fmt::format(
         "{}: pg[{}] is not registered for scrubbing", __func__, m_pg_id.pgid);