get_pgbackend()->auto_repair_supported());
return m_scrubber->start_scrub_session(
- candidate.level, osd_restrictions, pg_cond, m_planned_scrub);
+ candidate.level, osd_restrictions, pg_cond);
}
double PG::next_deepscrub_interval() const
void PG::scrub_requested(scrub_level_t scrub_level, scrub_type_t scrub_type)
{
ceph_assert(m_scrubber);
- std::ignore =
- m_scrubber->scrub_requested(scrub_level, scrub_type, m_planned_scrub);
+ std::ignore = m_scrubber->scrub_requested(scrub_level, scrub_type);
}
void PG::clear_ready_to_merge() {
{
out << pg.recovery_state;
- // listing all scrub-related flags - both current and "planned next scrub"
+ // listing all scrub-related flags
if (pg.is_scrubbing()) {
out << *pg.m_scrubber;
}
- out << pg.m_planned_scrub;
if (pg.recovery_ops_active)
out << " rops=" << pg.recovery_ops_active;
/// and be removed only in the PrimaryLogPG destructor.
std::unique_ptr<ScrubPgIF> m_scrubber;
- /// flags detailing scheduling/operation characteristics of the next scrub
- requested_scrub_t m_planned_scrub;
-
- const requested_scrub_t& get_planned_scrub() const {
- return m_planned_scrub;
- }
-
/// scrubbing state for both Primary & replicas
bool is_scrub_active() const { return m_scrubber->is_scrub_active(); }
OSDService* get_pg_osd(ScrubberPasskey) const { return osd; }
- requested_scrub_t& get_planned_scrub(ScrubberPasskey)
- {
- return m_planned_scrub;
- }
-
void force_object_missing(ScrubberPasskey,
const std::set<pg_shard_t>& peer,
const hobject_t& oid,
f->close_section();
if (is_primary() && is_active() && m_scrubber) {
- m_scrubber->dump_scrubber(f.get(), m_planned_scrub);
+ m_scrubber->dump_scrubber(f.get());
}
f->open_object_section("agent_state");
if (is_primary()) {
scrub_level_t deep = (prefix == "deep-scrub") ? scrub_level_t::deep
: scrub_level_t::shallow;
- m_scrubber->on_operator_forced_scrub(f.get(), deep, m_planned_scrub);
+ m_scrubber->on_operator_forced_scrub(f.get(), deep);
} else {
ss << "Not primary";
ret = -EPERM;
#ifdef DEBUG_RECOVERY_OIDS
recovering_oids.clear();
#endif
- dout(15) << __func__ << " flags: " << m_planned_scrub << dendl;
+ dout(15) << __func__ << dendl;
last_backfill_started = hobject_t();
set<hobject_t>::iterator i = backfills_in_flight.begin();
return out;
}
-ostream& operator<<(ostream& out, const requested_scrub_t& sf)
-{
- if (sf.req_scrub)
- out << " planned REQ_SCRUB";
-
- return out;
-}
-
void PgScrubber::on_replica_activate()
{
dout(10) << __func__ << dendl;
scrub_level_t PgScrubber::scrub_requested(
scrub_level_t scrub_level,
- scrub_type_t scrub_type,
- requested_scrub_t& req_flags)
+ scrub_type_t scrub_type)
{
const bool repair_requested = (scrub_type == scrub_type_t::do_repair);
const bool deep_requested =
scrub_level = deep_requested ? scrub_level_t::deep : scrub_level_t::shallow;
dout(10) << fmt::format(
"{}: {}{} scrub requested. "
- "@entry:{},last-stamp:{:s},Registered?{}",
+ "@entry:last-stamp:{:s},Registered?{}",
__func__,
(scrub_type == scrub_type_t::do_repair ? "repair + "
: "not-repair + "),
- (deep_requested ? "deep" : "shallow"), req_flags,
+ (deep_requested ? "deep" : "shallow"),
m_scrub_job->get_sched_time(), registration_state())
<< dendl;
return scrub_level_t::shallow;
}
- // modifying the planned-scrub flags - to be removed shortly
- // User might intervene, so clear this
- req_flags.req_scrub = true;
- dout(20) << fmt::format("{}: planned scrub:{}", __func__, req_flags) << dendl;
-
// update the relevant SchedTarget (either shallow or deep). Set its urgency
// to either operator_requested or must_repair. Push it into the queue
auto& trgt = m_scrub_job->get_target(scrub_level);
// when asked to force a high-priority scrub
void PgScrubber::on_operator_forced_scrub(
ceph::Formatter* f,
- scrub_level_t scrub_level,
- requested_scrub_t& request_flags)
+ scrub_level_t scrub_level)
{
- auto deep_req = scrub_requested(scrub_level, scrub_type_t::not_repair, request_flags);
+ auto deep_req = scrub_requested(scrub_level, scrub_type_t::not_repair);
asok_response_section(f, false, deep_req);
}
ceph_assert(m_pg->is_locked());
ceph_assert(is_queued_or_active());
- m_planned_scrub = requested_scrub_t{};
-
// if the repair request comes from auto-repair and large number of errors,
// we would like to cancel auto-repair
if (m_is_repair && m_flags.auto_repair &&
dout(10) << fmt::format(
"{}: executing target: {}. Session flags: {} up-to-date job: "
- "{} planned: {}",
- __func__, *m_active_target, m_flags, *m_scrub_job,
- m_planned_scrub)
+ "{}",
+ __func__, *m_active_target, m_flags, *m_scrub_job)
<< dendl;
// copy the aborted target
Scrub::schedule_result_t PgScrubber::start_scrub_session(
scrub_level_t s_or_d,
Scrub::OSDRestrictions osd_restrictions,
- Scrub::ScrubPGPreconds pg_cond,
- const requested_scrub_t& requested_flags)
+ Scrub::ScrubPGPreconds pg_cond)
{
auto& trgt = m_scrub_job->get_target(s_or_d);
dout(10) << fmt::format(
}
-/*
- * note that the flags-set fetched from the PG (m_pg->m_planned_scrub)
- * is cleared once scrubbing starts; Some of the values dumped here are
- * thus transitory.
- */
+///\todo modify the fields dumped here to match the new scrub-job structure
void PgScrubber::dump_scrubber(
- ceph::Formatter* f,
- const requested_scrub_t& request_flags) const
+ ceph::Formatter* f) const
{
f->open_object_section("scrubber");
, m_pg_id{pg->pg_id}
, m_osds{m_pg->osd}
, m_pg_whoami{pg->pg_whoami}
- , m_planned_scrub{pg->get_planned_scrub(ScrubberPasskey{})}
, preemption_data{pg}
{
m_fsm = std::make_unique<ScrubMachine>(m_pg, this);
Scrub::schedule_result_t start_scrub_session(
scrub_level_t s_or_d,
Scrub::OSDRestrictions osd_restrictions,
- Scrub::ScrubPGPreconds pg_cond,
- const requested_scrub_t& requested_flags) final;
+ Scrub::ScrubPGPreconds pg_cond) final;
void initiate_regular_scrub(epoch_t epoch_queued) final;
scrub_level_t scrub_requested(
scrub_level_t scrub_level,
- scrub_type_t scrub_type,
- requested_scrub_t& req_flags) final;
+ scrub_type_t scrub_type) final;
/**
* let the scrubber know that a recovery operation has completed.
void on_operator_forced_scrub(
ceph::Formatter* f,
- scrub_level_t scrub_level,
- requested_scrub_t& request_flags) final;
+ scrub_level_t scrub_level) final;
- void dump_scrubber(ceph::Formatter* f,
- const requested_scrub_t& request_flags) const final;
+ void dump_scrubber(ceph::Formatter* f) const final;
// used if we are a replica
scrub_flags_t m_flags;
- /// a reference to the details of the next scrub (as requested and managed by
- /// the PG)
- requested_scrub_t& m_planned_scrub;
-
bool m_active{false};
/**
} // namespace Scrub
-/**
- * Flags affecting the scheduling and behaviour of the *next* scrub.
- *
- * we hold two of these flag collections: one
- * for the next scrub, and one frozen at initiation (i.e. in pg::queue_scrub())
- */
-struct requested_scrub_t {
- /**
- * scrub must not be aborted.
- * Set for explicitly requested scrubs, and for scrubs originated by the
- * pairing process with the 'repair' flag set (in the RequestScrub event).
- *
- * Will be copied into the 'required' scrub flag upon scrub start.
- */
- bool req_scrub{false};
-};
-
-std::ostream& operator<<(std::ostream& out, const requested_scrub_t& sf);
-
-template <>
-struct fmt::formatter<requested_scrub_t> {
- constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
-
- template <typename FormatContext>
- auto format(const requested_scrub_t& rs, FormatContext& ctx) const
- {
- return fmt::format_to(ctx.out(),
- "(plnd:{})",
- rs.req_scrub ? " req_scrub" : "");
- }
-};
-
/**
* The interface used by the PG when requesting scrub-related info or services
*/
virtual Scrub::schedule_result_t start_scrub_session(
scrub_level_t s_or_d,
Scrub::OSDRestrictions osd_restrictions,
- Scrub::ScrubPGPreconds pg_cond,
- const requested_scrub_t& requested_flags) = 0;
+ Scrub::ScrubPGPreconds pg_cond) = 0;
virtual void set_op_parameters(Scrub::ScrubPGPreconds pg_cond) = 0;
/// ... by requesting an "operator initiated" scrub
virtual void on_operator_forced_scrub(
ceph::Formatter* f,
- scrub_level_t scrub_level,
- requested_scrub_t& request_flags) = 0;
+ scrub_level_t scrub_level) = 0;
- virtual void dump_scrubber(ceph::Formatter* f,
- const requested_scrub_t& request_flags) const = 0;
+ virtual void dump_scrubber(ceph::Formatter* f) const = 0;
/**
* Return true if soid is currently being scrubbed and pending IOs should
virtual scrub_level_t scrub_requested(
scrub_level_t scrub_level,
- scrub_type_t scrub_type,
- requested_scrub_t& req_flags) = 0;
+ scrub_type_t scrub_type) = 0;
/**
* let the scrubber know that a recovery operation has completed.