upd_flags.time_for_deep = time_for_deep;
upd_flags.deep_scrub_on_error = false;
- upd_flags.auto_repair = false; // will only be considered for periodic scrubs
+ upd_flags.auto_repair = false;
if (upd_flags.must_deep_scrub) {
upd_flags.calculated_to_deep = true;
}
}
+ if (try_to_auto_repair) {
+ // for shallow scrubs: rescrub if errors found
+ // for deep: turn 'auto-repair' on
+ if (upd_flags.calculated_to_deep) {
+ dout(10) << fmt::format(
+ "{}: performing an auto-repair deep scrub",
+ __func__)
+ << dendl;
+ upd_flags.auto_repair = true;
+ } else {
+ dout(10) << fmt::format(
+ "{}: will perform an auto-repair deep scrub if errors "
+ "are found",
+ __func__)
+ << dendl;
+ upd_flags.deep_scrub_on_error = true;
+ }
+ }
+
return upd_flags;
}
* the value of auto_repair is determined in sched_scrub() (once per scrub.
* previous value is not remembered). Set if
* - allowed by configuration and backend, and
- * - must_scrub is not set (i.e. - this is a periodic scrub),
- * - time_for_deep was just set
+ * - for periodic scrubs: time_for_deep was just set
*/
bool auto_repair{false};