]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/scrub: make m_session_started_at at Session state ctor 63799/head
authorRonen Friedman <rfriedma@redhat.com>
Wed, 4 Jun 2025 17:44:16 +0000 (12:44 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Sun, 8 Jun 2025 12:01:32 +0000 (07:01 -0500)
commite104a0bf8c401b490294deb18b512e98840c39d6
tree0bdac3916aed5eca9f29d5133c4b03f78c54553a
parent156364791a288e17fa0345f59194d19ba744890a
osd/scrub: make m_session_started_at at Session state ctor

ScrubMachine::get_time_scrubbing() must access the Session object
to compute the scrub duration. But the State data is not externally
accessible before its ctor has completed.

As we always happen to try to access that data inside the ctor,
this always results in a warning log message.

Here we move m_session_started_at into the outer state, simplifying
the logic required to access it.

Fixes: https://tracker.ceph.com/issues/64955
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
(cherry picked from commit 38057ce2c14ca9a6b81617399480510fb0eae951)
src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/scrub_machine.cc
src/osd/scrubber/scrub_machine.h