finish_degraded_object(p->first);
}
- // requeues waiting_for_scrub
- m_scrubber->scrub_clear_state();
+ ceph_assert(waiting_for_scrub.empty());
for (auto p = waiting_for_blocked_object.begin();
p != waiting_for_blocked_object.end();
void PgScrubber::cleanup_on_finish()
{
dout(10) << __func__ << dendl;
- ceph_assert(m_pg->is_locked());
-
- state_clear(PG_STATE_SCRUBBING);
- state_clear(PG_STATE_DEEP_SCRUB);
-
- m_local_osd_resource.reset();
- requeue_waiting();
-
- reset_internal_state();
- m_flags = scrub_flags_t{};
+ clear_pgscrub_state();
- // type-specific state clear
- _scrub_clear_state();
// PG state flags changed:
m_pg->publish_stats_to_osd();
}
-// uses process_event(), so must be invoked externally
-void PgScrubber::scrub_clear_state()
-{
- dout(10) << __func__ << dendl;
-
- clear_pgscrub_state();
- m_fsm->process_event(FullReset{});
-}
-
/*
* note: does not access the state-machine
*/
void on_replica_activate() final;
- void scrub_clear_state() final;
-
bool is_queued_or_active() const final;
/**
void on_replica_init() final;
void replica_handling_done() final;
- /// the version of 'scrub_clear_state()' that does not try to invoke FSM
- /// services (thus can be called from FSM reactions)
void clear_pgscrub_state() final;
-
std::chrono::milliseconds get_scrub_sleep_time() const final;
void queue_for_scrub_resched(Scrub::scrub_prio_t prio) final;
*/
std::unique_ptr<Scrub::LocalResourceWrapper> m_local_osd_resource;
- void cleanup_on_finish(); // scrub_clear_state() as called for a Primary when
- // Active->NotActive
+ /**
+ * clearing the scrubber state & the PG's scrub-related flags
+ * (calls clear_pgscrub_state()).
+ * Also - publishes the PG stats.
+ */
+ void cleanup_on_finish();
protected:
PG* const m_pg;
virtual void replica_handling_done() = 0;
- /// the version of 'scrub_clear_state()' that does not try to invoke FSM
- /// services (thus can be called from FSM reactions)
+ /**
+ * clears both internal scrub state, and some PG-visible flags:
+ * - the two scrubbing PG state flags;
+ * - primary/replica scrub position (chunk boundaries);
+ * - primary/replica interaction state;
+ * - the backend state;
+ * Also runs pending callbacks, and clears the active flags.
+ * Does not try to invoke FSM events.
+ */
virtual void clear_pgscrub_state() = 0;
/// Get time to sleep before next scrub
/// we are peered as a replica
virtual void on_replica_activate() = 0;
- virtual void scrub_clear_state() = 0;
-
virtual void handle_query_state(ceph::Formatter* f) = 0;
virtual pg_scrubbing_status_t get_schedule() const = 0;
const hobject_t& soid) = 0;
/**
- * the version of 'scrub_clear_state()' that does not try to invoke FSM
- * services (thus can be called from FSM reactions)
+ * clears both internal scrub state, and some PG-visible flags:
+ * - the two scrubbing PG state flags;
+ * - primary/replica scrub position (chunk boundaries);
+ * - primary/replica interaction state;
+ * - the backend state
+ * Also runs pending callbacks, and clears the active flags.
+ * Does not try to invoke FSM events.
*/
virtual void clear_pgscrub_state() = 0;