osd/scrubber: rename advance_token to reset_replica_state

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>
This commit is contained in:
Samuel Just 2023-02-08 07:00:09 +00:00
parent 97e4891fa1
commit 285901a700
2 changed files with 4 additions and 10 deletions

View 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{});

View 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);