* a wrapper around the actual reservation, and that object releases
* the local resource automatically when reset.
*/
-bool PgScrubber::reserve_local()
-{
- // Implementation note re the 'is high priority' parameter:
- // In this step in the scrub scheduling rework, at the point of the call to
- // this function, set_op_params() was not yet called, and we cannot rely
- // on m_is_deep to determine the scrub level. So for now - we check both
- // targets here.
- const bool is_hp =
- m_scrub_job->is_job_high_priority(scrub_level_t::shallow) ||
- m_scrub_job->is_job_high_priority(scrub_level_t::deep);
+bool PgScrubber::reserve_local(const Scrub::SchedTarget& trgt)
+{
+ const bool is_hp = !ScrubJob::observes_max_concurrency(trgt.urgency());
m_local_osd_resource = m_osds->get_scrub_services().inc_scrubs_local(is_hp);
if (m_local_osd_resource) {
* Fails if OSD's local-scrubs budget was exhausted
* \returns were local resources reserved?
*/
- bool reserve_local() final;
+ bool reserve_local(const Scrub::SchedTarget& trgt);
void handle_query_state(ceph::Formatter* f) final;
bool only_deadlined{false};
bool load_is_low:1{true};
bool time_permit:1{true};
+ bool max_concurrency_reached:1{false};
+ bool recovery_in_progress:1{false};
};
static_assert(sizeof(Scrub::OSDRestrictions) <= sizeof(uint32_t));
virtual void update_scrub_stats(
ceph::coarse_real_clock::time_point now_is) = 0;
- // --------------- reservations -----------------------------------
-
- /**
- * Reserve local scrub resources (managed by the OSD)
- *
- * Fails if OSD's local-scrubs budget was exhausted
- * \returns were local resources reserved?
- */
- virtual bool reserve_local() = 0;
-
/**
* Recalculate scrub (both deep & shallow) schedules
*
*/
virtual void update_scrub_job(Scrub::delay_ready_t delay_ready) = 0;
+
+ // --------------- reservations -----------------------------------
+
/**
* route incoming replica-reservations requests/responses to the
* appropriate handler.