]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/scrub: do not reduce min chunk on preemption
authorRonen Friedman <rfriedma@redhat.com>
Thu, 9 Oct 2025 07:31:30 +0000 (02:31 -0500)
committerVenky Shankar <vshankar@redhat.com>
Tue, 28 Oct 2025 08:09:11 +0000 (08:09 +0000)
Existing logic handling scrub preemptions is halving both the
'max' and the 'min' values.
This isn't optimal: the 'min' values (used mainly to guarantee a minimal
number of objects to fetch from the backend in one operation) can and
should also be used to limit the effect of preemptions on the execution
of the scrub.

Fixes: https://tracker.ceph.com/issues/73410
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/common/options/osd.yaml.in
src/osd/scrubber/pg_scrubber.cc

index 03c052790449b24f7da10990e9d4e6dc17db5569..b89cb7f45ffe1834afa18895f3bb25505a554871 100644 (file)
@@ -379,8 +379,9 @@ options:
   type: int
   level: advanced
   desc: Minimum number of objects to deep-scrub in a single chunk
-  fmt_desc: The minimal number of object store chunks to scrub during single operation.
-    Ceph blocks writes to single chunk during scrub.
+  fmt_desc: The minimum number of objects to scrub during single operation. Also
+    serves as a minimal chunk size even after scrubbing is preempted by client
+    operations and the effective chunk size is halved.
   default: 5
   see_also:
   - osd_scrub_chunk_max
@@ -1559,7 +1560,7 @@ options:
   type: int
   level: advanced
   default: 512
-  fmt_desc: The maximum number of objects per backfill scan.p
+  fmt_desc: The maximum number of objects per backfill scan.
   with_legacy: true
 - name: osd_extblkdev_plugins
   type: str
index 3a66b65327939eb1189cc4da2aacc9f6a16d7332..243d18c1712524624713925efad35c6563854977 100644 (file)
@@ -911,8 +911,8 @@ std::optional<uint64_t> PgScrubber::select_range()
   const int max_from_conf = static_cast<int>(size_from_conf(
       m_is_deep, conf, osd_scrub_chunk_max, osd_shallow_scrub_chunk_max));
 
+  const int min_chunk_sz = std::max(3, min_from_conf);
   const int divisor = static_cast<int>(preemption_data.chunk_divisor());
-  const int min_chunk_sz = std::max(3, min_from_conf / divisor);
   const int max_chunk_sz = std::max(min_chunk_sz, max_from_conf / divisor);
 
   dout(10) << fmt::format(