From: Prashant D Date: Tue, 13 Sep 2022 15:04:02 +0000 (-0400) Subject: pacific: osd/scrub: Reintroduce scrub starts message X-Git-Tag: v16.2.11~60^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ffeef41c8e8606e9c886090e6e5f862700370204;p=ceph.git pacific: osd/scrub: Reintroduce scrub starts message Whenever the scrubbing process starts for a PG, We used to log scrub/deep-scrub "starts" message in the cluster log. We are not seeing scrub "starts" messages anymore. Reintroduce scrub starts message in order to calculate exact time taken to scrub/deep-scrub the PG. Backporting of PR#46438 to pacific is non-trivial hence this PR is specific to pacific release to introduce scrub "starts" message. Signed-off-by: Prashant D --- diff --git a/src/osd/pg_scrubber.cc b/src/osd/pg_scrubber.cc index a686d8a4c4a2..fd7825cc6591 100644 --- a/src/osd/pg_scrubber.cc +++ b/src/osd/pg_scrubber.cc @@ -1930,6 +1930,14 @@ PgScrubber::PgScrubber(PG* pg) m_fsm->initiate(); } +void PgScrubber::scrub_begin() +{ + stringstream ss; + ss << m_pg->info.pgid.pgid << " " << m_mode_desc << " starts"; + dout(2) << ss.str() << dendl; + m_osds->clog->debug(ss); +} + void PgScrubber::reserve_replicas() { dout(10) << __func__ << dendl; diff --git a/src/osd/pg_scrubber.h b/src/osd/pg_scrubber.h index 0406544fbed4..392a4a588026 100644 --- a/src/osd/pg_scrubber.h +++ b/src/osd/pg_scrubber.h @@ -375,6 +375,8 @@ class PgScrubber : public ScrubPgIF, public ScrubMachineListener { void on_digest_updates() final; + void scrub_begin() final; + void scrub_finish() final; ScrubMachineListener::MsgAndEpoch diff --git a/src/osd/scrub_machine.cc b/src/osd/scrub_machine.cc index 1d08af581279..fff3720817e7 100644 --- a/src/osd/scrub_machine.cc +++ b/src/osd/scrub_machine.cc @@ -103,6 +103,7 @@ ReservingReplicas::ReservingReplicas(my_context ctx) : my_base(ctx) { dout(10) << "-- state -->> ReservingReplicas" << dendl; DECLARE_LOCALS; // 'scrbr' & 'pg_id' aliases + scrbr->scrub_begin(); scrbr->reserve_replicas(); } diff --git a/src/osd/scrub_machine_lstnr.h b/src/osd/scrub_machine_lstnr.h index 564fa77a1f06..8d9622b9bde8 100644 --- a/src/osd/scrub_machine_lstnr.h +++ b/src/osd/scrub_machine_lstnr.h @@ -89,6 +89,8 @@ struct ScrubMachineListener { virtual void on_digest_updates() = 0; + virtual void scrub_begin() = 0; + /// the part that actually finalizes a scrub virtual void scrub_finish() = 0;