From: Ronen Friedman Date: Thu, 9 Oct 2025 07:31:30 +0000 (-0500) Subject: osd/scrub: do not reduce min chunk on preemption X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e8ec7d08ac7a7302abd27185dca2660df9c429f;p=ceph.git osd/scrub: do not reduce min chunk on preemption 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 --- diff --git a/src/common/options/osd.yaml.in b/src/common/options/osd.yaml.in index 03c052790449..b89cb7f45ffe 100644 --- a/src/common/options/osd.yaml.in +++ b/src/common/options/osd.yaml.in @@ -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 diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc index 222e80c50804..b106e8c0df1c 100644 --- a/src/osd/scrubber/pg_scrubber.cc +++ b/src/osd/scrubber/pg_scrubber.cc @@ -911,8 +911,8 @@ std::optional PgScrubber::select_range() const int max_from_conf = static_cast(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(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(