Skip to content

Commit e9f41e8

Browse files
committed
osd/scrub: clarify that osd_scrub_auto_repair_num_errors counts objects
'osd_scrub_auto_repair_num_errors' limits the number of damaged objects that we will try to auto-repair during a scrub. Its documentation referred to "number of errors", which did not fit the implementation. Fixes: https://tracker.ceph.com/issues/71754 Fixes: Red Hat BZ2316244 Signed-off-by: Ronen Friedman <[email protected]> (cherry picked from commit 680b58f)
1 parent da27661 commit e9f41e8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/common/options/osd.yaml.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,15 +457,17 @@ options:
457457
desc: Automatically repair damaged objects detected during scrub
458458
fmt_desc: Setting this to ``true`` will enable automatic PG repair when errors
459459
are found by scrubs or deep-scrubs. However, if more than
460-
``osd_scrub_auto_repair_num_errors`` errors are found a repair is NOT performed.
460+
``osd_scrub_auto_repair_num_errors`` damaged objects are found
461+
a repair is NOT performed.
461462
default: false
462463
with_legacy: true
463464
# only auto-repair when number of errors is below this threshold
464465
- name: osd_scrub_auto_repair_num_errors
465466
type: uint
466467
level: advanced
467-
desc: Maximum number of detected errors to automatically repair
468-
fmt_desc: Auto repair will not occur if more than this many errors are found.
468+
desc: Maximum number of damaged objects to automatically repair
469+
fmt_desc: Scrub will not perform automatic repair if more than this many
470+
damaged objects are found.
469471
default: 5
470472
see_also:
471473
- osd_scrub_auto_repair

src/osd/scrubber/pg_scrubber.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,8 +1825,8 @@ void PgScrubber::scrub_finish()
18251825
ceph_assert(m_pg->is_locked());
18261826
ceph_assert(is_queued_or_active());
18271827

1828-
// if the repair request comes from auto-repair and large number of errors,
1829-
// we would like to cancel auto-repair
1828+
// if the repair request comes from auto-repair and there is a large
1829+
// number of objects known to be damaged, we cancel the auto-repair
18301830
if (m_is_repair && m_flags.auto_repair &&
18311831
m_be->authoritative_peers_count() >
18321832
static_cast<int>(m_pg->cct->_conf->osd_scrub_auto_repair_num_errors)) {
@@ -1839,8 +1839,8 @@ void PgScrubber::scrub_finish()
18391839

18401840
m_be->update_repair_status(m_is_repair);
18411841

1842-
// if a regular scrub had errors within the limit, do a deep scrub to auto
1843-
// repair
1842+
// if the count of damaged objects found in shallow-scrubbing is not
1843+
// too high - do a deep scrub to auto repair
18441844
bool do_auto_scrub = false;
18451845
if (m_flags.deep_scrub_on_error && m_be->authoritative_peers_count() &&
18461846
m_be->authoritative_peers_count() <=

0 commit comments

Comments
 (0)