@@ -460,14 +460,12 @@ void PgScrubber::on_new_interval()
460460 (is_primary () ? " Primary" : " Replica/other" ),
461461 is_scrub_active (), is_queued_or_active ())
462462 << dendl;
463-
464463 m_fsm->process_event (IntervalChanged{});
465464 // the following asserts were added due to a past bug, where PG flags were
466465 // left set in some scenarios.
467466 ceph_assert (!is_queued_or_active ());
468467 ceph_assert (!state_test (PG_STATE_SCRUBBING));
469468 ceph_assert (!state_test (PG_STATE_DEEP_SCRUB));
470- rm_from_osd_scrubbing ();
471469}
472470
473471bool PgScrubber::is_scrub_registered () const
@@ -493,35 +491,31 @@ void PgScrubber::rm_from_osd_scrubbing()
493491 }
494492}
495493
496- void PgScrubber::on_pg_activate (const requested_scrub_t & request_flags)
494+ /*
495+ * Note: referring to m_planned_scrub here is temporary, as this set of
496+ * scheduling flags will be removed in a followup PR.
497+ */
498+ void PgScrubber::schedule_scrub_with_osd ()
497499{
498500 ceph_assert (is_primary ());
499- if (!m_scrub_job) {
500- // we won't have a chance to see more logs from this function, thus:
501- dout (2 ) << fmt::format (
502- " {}: flags:<{}> {}.Reg-state:{:.7}. No scrub-job" , __func__,
503- request_flags, (is_primary () ? " Primary" : " Replica/other" ),
504- registration_state ())
505- << dendl;
506- return ;
507- }
501+ ceph_assert (m_scrub_job);
508502
509- ceph_assert (!is_queued_or_active ());
510503 auto pre_state = m_scrub_job->state_desc ();
511504 auto pre_reg = registration_state ();
512505
513506 auto suggested = m_osds->get_scrub_services ().determine_scrub_time (
514- request_flags , m_pg->info , m_pg->get_pgpool ().info .opts );
507+ m_planned_scrub , m_pg->info , m_pg->get_pgpool ().info .opts );
515508 m_osds->get_scrub_services ().register_with_osd (m_scrub_job, suggested);
516509
517510 dout (10 ) << fmt::format (
518511 " {}: <flags:{}> {} <{:.5}>&<{:.10}> --> <{:.5}>&<{:.14}>" ,
519- __func__, request_flags ,
512+ __func__, m_planned_scrub ,
520513 (is_primary () ? " Primary" : " Replica/other" ), pre_reg,
521514 pre_state, registration_state (), m_scrub_job->state_desc ())
522515 << dendl;
523516}
524517
518+
525519void PgScrubber::on_primary_active_clean ()
526520{
527521 dout (10 ) << fmt::format (
@@ -2177,11 +2171,7 @@ void PgScrubber::handle_query_state(ceph::Formatter* f)
21772171PgScrubber::~PgScrubber ()
21782172{
21792173 m_fsm->process_event (IntervalChanged{});
2180- if (m_scrub_job) {
2181- // make sure the OSD won't try to scrub this one just now
2182- rm_from_osd_scrubbing ();
2183- m_scrub_job.reset ();
2184- }
2174+ m_scrub_job.reset ();
21852175}
21862176
21872177PgScrubber::PgScrubber (PG* pg)
0 commit comments