]> git-server-git.apps.pok.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)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 2 Dec 2025 13:16:16 +0000 (07:16 -0600)
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>
(cherry picked from commit 3e8ec7d08ac7a7302abd27185dca2660df9c429f)
(cherry picked from commit cdd5bd59e7f205b6f3a3cba8b25f8b05399d383d)

src/common/options/osd.yaml.in
src/osd/scrubber/pg_scrubber.cc

index 7fda01f7c246471b9c3cdd03e87eedac50fb8316..dd89b13e38b5560f86701c37f447ec099dcc21cc 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
@@ -1541,7 +1542,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 1d0af0ebfa13e5b8afce97cd0566222c7cfd0e23..ccb3e0d9bc0aed418b7153bdf766d7f62fa8d918 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(