return;
}
- Scrub::ScrubPreconds env_conditions;
+ Scrub::OSDRestrictions env_conditions;
if (service.is_recovery_active() && !cct->_conf->osd_scrub_during_recovery) {
if (!cct->_conf->osd_repair_during_recovery) {
* - try that one. If not suitable, discard from 'to_scrub_copy'
*/
Scrub::schedule_result_t ScrubQueue::select_pg_and_scrub(
- Scrub::ScrubPreconds& preconds)
+ Scrub::OSDRestrictions& preconds)
{
dout(10) << " reg./pen. sizes: " << to_scrub.size() << " / "
<< penalized.size() << dendl;
// not holding jobs_lock. 'group' is a copy of the actual list.
Scrub::schedule_result_t ScrubQueue::select_from_group(
ScrubQContainer& group,
- const Scrub::ScrubPreconds& preconds,
+ const Scrub::OSDRestrictions& preconds,
utime_t now_is)
{
dout(15) << "jobs #: " << group.size() << dendl;
*
* locking: locks jobs_lock
*/
- Scrub::schedule_result_t select_pg_and_scrub(Scrub::ScrubPreconds& preconds);
+ Scrub::schedule_result_t select_pg_and_scrub(Scrub::OSDRestrictions& preconds);
/**
* Translate attempt_ values into readable text
Scrub::schedule_result_t select_from_group(
ScrubQContainer& group,
- const Scrub::ScrubPreconds& preconds,
+ const Scrub::OSDRestrictions& preconds,
utime_t now_is);
protected: // used by the unit-tests
using act_token_t = uint32_t;
/// "environment" preconditions affecting which PGs are eligible for scrubbing
-struct ScrubPreconds {
+struct OSDRestrictions {
bool allow_requested_repair_only{false};
bool load_is_low{true};
bool time_permit{true};
bool only_deadlined{false};
};
+} // namespace Scrub
+
+namespace fmt {
+template <>
+struct formatter<Scrub::OSDRestrictions> {
+ constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
+
+ template <typename FormatContext>
+ auto format(const Scrub::OSDRestrictions& conds, FormatContext& ctx)
+ {
+ return fmt::format_to(
+ ctx.out(),
+ "overdue-only:{} load:{} time:{} repair-only:{}",
+ conds.only_deadlined,
+ conds.load_is_low ? "ok" : "high",
+ conds.time_permit ? "ok" : "no",
+ conds.allow_requested_repair_only);
+ }
+};
+} // namespace fmt
+
+namespace Scrub {
+
/// PG services used by the scrubber backend
struct PgScrubBeListener {
virtual ~PgScrubBeListener() = default;