when determining whether replica reservations are required.
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
return m_osds->whoami;
}
-[[nodiscard]] bool PgScrubber::is_high_priority() const
+[[nodiscard]] bool PgScrubber::is_reservation_required() const
{
- return m_flags.required;
+ ceph_assert(m_active_target);
+ return ScrubJob::requires_reservation(m_active_target->urgency());
}
/*
return m_pg->recovery_state.is_primary();
}
- /// is this scrub more than just regular periodic scrub?
- [[nodiscard]] bool is_high_priority() const final;
+ /// is this scrub's urgency high enough, or must it reserve its replicas?
+ [[nodiscard]] bool is_reservation_required() const final;
void set_state_name(const char* name) final
{
/// delay next retry of this PG after a replica reservation failure
virtual void flag_reservations_failure() = 0;
- /// is this scrub more than just regular periodic scrub?
- [[nodiscard]] virtual bool is_high_priority() const = 0;
+ /// is this scrub's urgency high enough, or must it reserve its replicas?
+ [[nodiscard]] virtual bool is_reservation_required() const = 0;
};
m_perf_set.set(scrbcnt_resrv_replicas_num, m_sorted_secondaries.size());
m_next_to_request = m_sorted_secondaries.cbegin();
- if (m_scrubber.is_high_priority()) {
+ if (m_scrubber.is_reservation_required()) {
+ // send out the 1'st request (unless we have no replicas)
+ m_process_started_at = ScrubClock::now();
+ send_next_reservation_or_complete();
+ } else {
// for high-priority scrubs (i.e. - user-initiated), no reservations are
// needed. Note: not perf-counted as either success or failure.
dout(10) << "high-priority scrub - no reservations needed" << dendl;
m_perf_set.inc(scrbcnt_resrv_skipped);
- } else {
- // send out the 1'st request (unless we have no replicas)
- m_process_started_at = ScrubClock::now();
- send_next_reservation_or_complete();
}
}