]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrubber: rename advance_token to reset_replica_state
authorSamuel Just <sjust@redhat.com>
Wed, 8 Feb 2023 07:00:09 +0000 (07:00 +0000)
committerSamuel Just <sjust@redhat.com>
Wed, 12 Apr 2023 03:39:19 +0000 (20:39 -0700)
Also removes misleading comment -- because primaries may
freely reset scrub, there may well be valid scrub state.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/pg_scrubber.h

index 42a89789b3ce95ab485acdead67a0e596c98a54d..f502482afc89f09d1cf128680d6990e9cb2a86c0 100644 (file)
@@ -1600,7 +1600,7 @@ void PgScrubber::handle_scrub_reserve_request(OpRequestRef op)
   /* The primary may unilaterally restart the scrub process without notifying
    * replicas.  Unconditionally clear any existing state prior to handling
    * the new reservation. */
-  advance_token();
+  reset_replica_state();
   
   bool granted{false};
   if (m_pg->cct->_conf->osd_scrub_during_recovery ||
@@ -1661,7 +1661,7 @@ void PgScrubber::handle_scrub_reserve_release(OpRequestRef op)
    * this specific scrub session has terminated. All incoming events carrying
    *  the old tag will be discarded.
    */
-  advance_token();
+  reset_replica_state();
 }
 
 void PgScrubber::discard_replica_reservations()
@@ -2338,18 +2338,12 @@ void PgScrubber::reset_internal_state()
   m_be.reset();
 }
 
-// note that only applicable to the Replica:
-void PgScrubber::advance_token()
+void PgScrubber::reset_replica_state()
 {
   dout(10) << fmt::format("{}: prev. token:{}", __func__, m_current_token)
           << dendl;
 
   m_current_token++;
-
-  // when advance_token() is called, it is assumed that no scrubbing takes
-  // place. We will, though, verify that. And if we are actually still handling
-  // a stale request - both our internal state and the FSM state will be
-  // cleared.
   m_remote_osd_resource.reset();
   replica_handling_done();
   m_fsm->process_event(FullReset{});
index f56643c0e493864547d69de106e9fb1c3a2b574a..3a3fd154a1778101d406d2befd2b4d647721c60c 100644 (file)
@@ -669,7 +669,7 @@ class PgScrubber : public ScrubPgIF,
    *  the current scrubbing operation is done. We should mark that fact, so that
    *  all events related to the previous operation can be discarded.
    */
-  void advance_token();
+  void reset_replica_state();
 
   bool is_token_current(Scrub::act_token_t received_token);