Skip to content

Commit 3e8ec7d

Browse files
committed
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 <[email protected]>
1 parent bae81a5 commit 3e8ec7d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/common/options/osd.yaml.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,9 @@ options:
379379
type: int
380380
level: advanced
381381
desc: Minimum number of objects to deep-scrub in a single chunk
382-
fmt_desc: The minimal number of object store chunks to scrub during single operation.
383-
Ceph blocks writes to single chunk during scrub.
382+
fmt_desc: The minimum number of objects to scrub during single operation. Also
383+
serves as a minimal chunk size even after scrubbing is preempted by client
384+
operations and the effective chunk size is halved.
384385
default: 5
385386
see_also:
386387
- osd_scrub_chunk_max
@@ -1559,7 +1560,7 @@ options:
15591560
type: int
15601561
level: advanced
15611562
default: 512
1562-
fmt_desc: The maximum number of objects per backfill scan.p
1563+
fmt_desc: The maximum number of objects per backfill scan.
15631564
with_legacy: true
15641565
- name: osd_extblkdev_plugins
15651566
type: str

src/osd/scrubber/pg_scrubber.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,8 @@ std::optional<uint64_t> PgScrubber::select_range()
911911
const int max_from_conf = static_cast<int>(size_from_conf(
912912
m_is_deep, conf, osd_scrub_chunk_max, osd_shallow_scrub_chunk_max));
913913

914+
const int min_chunk_sz = std::max(3, min_from_conf);
914915
const int divisor = static_cast<int>(preemption_data.chunk_divisor());
915-
const int min_chunk_sz = std::max(3, min_from_conf / divisor);
916916
const int max_chunk_sz = std::max(min_chunk_sz, max_from_conf / divisor);
917917

918918
dout(10) << fmt::format(

0 commit comments

Comments
 (0)