]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: scrub components embedded documentation
authorRonen Friedman <rfriedma@redhat.com>
Thu, 30 Dec 2021 13:04:58 +0000 (13:04 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Sat, 22 Jan 2022 10:37:05 +0000 (10:37 +0000)
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/osd_scrub_sched.h
src/osd/scrubber/pg_scrubber.h
src/osd/scrubber/scrub_backend.h

index fc34be7a2019b77c7ea423dadf4b381255693270..98309eb47fb16fb793dc8dad9006912c8a0f5777 100644 (file)
@@ -2,6 +2,110 @@
 // vim: ts=8 sw=2 smarttab
 
 #pragma once
+// clang-format off
+/*
+┌───────────────────────┐
+│ OSD                   │
+│ OSDService           ─┼───┐
+│                       │   │
+│                       │   │
+└───────────────────────┘   │   Ownes & uses the following
+                            │   ScrubQueue interfaces:
+                            │
+                            │
+                            │   - resource management (*1)
+                            │
+                            │   - environment conditions (*2)
+                            │
+                            │   - scrub scheduling (*3)
+                            │
+                            │
+                            │
+                            │
+                            │
+                            │
+ ScrubQueue                 │
+┌───────────────────────────▼────────────┐
+│                                        │
+│                                        │
+│  ScrubQContainer    to_scrub <>────────┼────────┐
+│  ScrubQContainer    penalized          │        │
+│                                        │        │
+│                                        │        │
+│  OSD_wide resource counters            │        │
+│                                        │        │
+│                                        │        │
+│  "env scrub conditions" monitoring     │        │
+│                                        │        │
+│                                        │        │
+│                                        │        │
+│                                        │        │
+└─▲──────────────────────────────────────┘        │
+  │                                               │
+  │                                               │
+  │uses interface <4>                             │
+  │                                               │
+  │                                               │
+  │            ┌──────────────────────────────────┘
+  │            │                 shared ownership of jobs
+  │            │
+  │      ┌─────▼──────┐
+  │      │ScrubJob    │
+  │      │            ├┐
+  │      │            ││
+  │      │            │┼┐
+  │      │            │┼│
+  └──────┤            │┼┤◄──────┐
+         │            │┼│       │
+         │            │┼│       │
+         │            │┼│       │
+         └┬───────────┼┼│       │shared ownership
+          └─┼┼┼┼┼┼┼┼┼┼┼┼│       │
+            └───────────┘       │
+                                │
+                                │
+                                │
+                                │
+┌───────────────────────────────┼─┐
+│                               <>│
+│PgScrubber                       │
+│                                 │
+│                                 │
+│                                 │
+│                                 │
+│                                 │
+└─────────────────────────────────┘
+
+
+SqrubQueue interfaces (main functions):
+
+<1> - OSD/PG resources management:
+
+  - can_inc_scrubs()
+  - {inc/dec}_scrubs_{local/remote}()
+  - dump_scrub_reservations()
+  - {set/clear/is}_reserving_now()
+
+<2> - environment conditions:
+
+  - update_loadavg()
+
+  - scrub_load_below_threshold()
+  - scrub_time_permit()
+
+<3> - scheduling scrubs:
+
+  - select_pg_and_scrub()
+  - dump_scrubs()
+
+<4> - manipulating a job's state:
+
+  - register_with_osd()
+  - remove_from_osd_queue()
+  - update_job()
+
+ */
+// clang-format on
 
 #include <atomic>
 #include <chrono>
index 6fffed57bd3b45a708e76dcca026449d54dc0408..313ab7be5cbfbf836be707317dd2a1cce3be3dfe 100644 (file)
@@ -25,7 +25,7 @@ Main Scrubber interfaces:
                                  │
                                  │
 ┌────────────────────────────────▼──────────────────┐
-│               ScrubPgIf                           │
+│               <<ScrubPgIF>>                       │
 └───────────────────────────▲───────────────────────┘
                             │
                             │
@@ -45,7 +45,7 @@ Main Scrubber interfaces:
       │                   │                         implements
       │    ownes & uses   │                                 │
       │                   │       ┌─────────────────────────▼──────┐
-      │                   │       │    ScrubMachineListener        │
+      │                   │       │    <<ScrubMachineListener>>    │
       │                   │       └─────────▲──────────────────────┘
       │                   │                 │
       │                   │                 │
index 573465d5c5037119bbfe346ff0f8b0283778a443..c866153fb55656cab0db16935dbbc6cb4004f20f 100644 (file)
@@ -271,15 +271,6 @@ class ScrubBackend {
   ConfigProxy& m_conf;
   LogChannelRef clog;
 
-  int num_digest_updates_pending{0};
-
- public:  
-  // as used by PgScrubber::final_cstat_update(). consider relocating.
-  // actually - only filled in by the PG backend, and used by the scrubber.
-  // We are not handling it. So consider getting it from the Scrubber, or
-  // creating it by the PG-BE
-  omap_stat_t m_omap_stats = (const struct omap_stat_t){0};
-
  private:
   using auth_and_obj_errs_t =
     std::tuple<std::list<pg_shard_t>,  ///< the auth-list