File tree Expand file tree Collapse file tree 4 files changed +17
-5
lines changed
Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -1606,7 +1606,9 @@ void PgScrubber::set_op_parameters(ScrubPGPreconds pg_cond)
16061606 state_set (PG_STATE_DEEP_SCRUB);
16071607 }
16081608
1609- m_flags.auto_repair = m_is_deep && pg_cond.can_autorepair ;
1609+ m_flags.auto_repair =
1610+ m_is_deep && pg_cond.can_autorepair &&
1611+ ScrubJob::is_autorepair_allowed (m_active_target->urgency ());
16101612
16111613 // m_is_repair is set for all repair cases - for operator-requested
16121614 // repairs, for deep-scrubs initiated automatically after a shallow scrub
@@ -1845,7 +1847,10 @@ void PgScrubber::scrub_finish()
18451847 static_cast <int >(m_pg->cct ->_conf ->osd_scrub_auto_repair_num_errors )) {
18461848 ceph_assert (!m_is_deep);
18471849 do_auto_scrub = true ;
1848- dout (15 ) << __func__ << " Try to auto repair after scrub errors" << dendl;
1850+ dout (10 ) << fmt::format (" {}: will initiate a deep scrub to fix {} errors" ,
1851+ __func__,
1852+ m_be->authoritative_peers_count ())
1853+ << dendl;
18491854 }
18501855
18511856 m_flags.deep_scrub_on_error = false ;
Original file line number Diff line number Diff line change @@ -411,6 +411,12 @@ bool ScrubJob::has_high_queue_priority(urgency_t urgency)
411411
412412bool ScrubJob::is_repair_implied (urgency_t urgency)
413413{
414- return urgency == urgency_t ::after_repair ||
414+ return urgency == urgency_t ::repairing || urgency == urgency_t ::must_repair;
415+ }
416+
417+ bool ScrubJob::is_autorepair_allowed (urgency_t urgency)
418+ {
419+ // note: 'after-repair' scrubs are not allowed to auto-repair
420+ return urgency == urgency_t ::periodic_regular ||
415421 urgency == urgency_t ::repairing || urgency == urgency_t ::must_repair;
416422}
Original file line number Diff line number Diff line change @@ -371,6 +371,8 @@ class ScrubJob {
371371 static bool has_high_queue_priority (urgency_t urgency);
372372
373373 static bool is_repair_implied (urgency_t urgency);
374+
375+ static bool is_autorepair_allowed (urgency_t urgency);
374376};
375377} // namespace Scrub
376378
Original file line number Diff line number Diff line change @@ -34,8 +34,7 @@ namespace Scrub {
3434 *
3535 * 'after_repair' - triggered immediately after a recovery process
3636 * ('m_after_repair_scrub_required' was set).
37- * This type of scrub is always deep.
38- * (note: this urgency level is not implemented in this commit)
37+ * This type of scrub is always deep, and never auto-repairs.
3938 *
4039 * 'repairing' - the target is currently being deep-scrubbed with the repair
4140 * flag set. Triggered by a previous shallow scrub that ended with errors.
You can’t perform that action at this time.
0 commit comments