]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: remove the fast track (w/o resources acquisition) for repair scrubs 42684/head
authorRonen Friedman <rfriedma@redhat.com>
Fri, 20 Aug 2021 15:33:25 +0000 (15:33 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Fri, 20 Aug 2021 15:33:25 +0000 (15:33 +0000)
Previously, after-repair scrubs were started without waiting for either local
or remote OSDs' scrub resources.
The tagging of scrub sessions by the replicas is based on monitoring replica-request
and replica-release messages from the primary. Scrub-map requests arriving without
any reservations interfere with this mechanism.
The benefits of this fast-track were limited at best, and do not justify the complexity
of a solution that accommodates both the bypass and the tagging.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/scrub_machine.h

index 40d58561c35a202a028c06f14fc47404b33ffcf6..644a6a9be9aa710ab82d34bb77157d9da90b3802 100644 (file)
@@ -2558,7 +2558,7 @@ std::pair<ghobject_t, bool> PG::do_delete_work(
       epoch_t e = get_osdmap()->get_epoch();
       PGRef pgref(this);
       auto delete_requeue_callback = new LambdaContext([this, pgref, e](int r) {
-        dout(20) << __func__ << " wake up at "
+        dout(20) << "do_delete_work() [cb] wake up at "
                  << ceph_clock_now()
                 << ", re-queuing delete" << dendl;
         std::scoped_lock locker{*this};
index 4f765d9f2d8a5f2db3634668c909d26f7b974f0e..6afa900ed6c57fa485b8c94d786dbf5ea042d594 100644 (file)
@@ -384,6 +384,7 @@ public:
   /**
    *  a special version of PG::scrub(), which:
    *  - is initiated after repair, and
+   * (not true anymore:)
    *  - is not required to allocate local/remote OSD scrub resources
    */
   void recovery_scrub(epoch_t queued, ThreadPool::TPHandle& handle)
index dd44f106152844d873f200b07c75f4091893c6ec..998bc5fe9c46532ae67e5dc23349d25ab849e3f3 100644 (file)
@@ -144,6 +144,11 @@ class ScrubMachine : public sc::state_machine<ScrubMachine, NotActive> {
  *    not required to reserve resources.
  *  - (for a replica) 'StartReplica' or 'StartReplicaNoWait', triggered by an incoming
  *    MOSDRepScrub message.
+ *
+ *  note (20.8.21): originally, AfterRepairScrub was triggering a scrub without waiting
+ *   for replica resources to be acquired. But once replicas started using the
+ *   resource-request to identify and tag the scrub session, this bypass cannot be
+ *   supported anymore.
  */
 struct NotActive : sc::state<NotActive, ScrubMachine> {
   explicit NotActive(my_context ctx);
@@ -151,7 +156,7 @@ struct NotActive : sc::state<NotActive, ScrubMachine> {
   using reactions = mpl::list<sc::transition<StartScrub, ReservingReplicas>,
                              // a scrubbing that was initiated at recovery completion,
                              // and requires no resource reservations:
-                             sc::transition<AfterRepairScrub, ActiveScrubbing>,
+                             sc::transition<AfterRepairScrub, ReservingReplicas>,
                              sc::transition<StartReplica, ReplicaWaitUpdates>,
                              sc::transition<StartReplicaNoWait, ActiveReplica>>;
 };