osd/scrub: only call publish_stats_to_osd() where allowed and needed
This patch removes several unnecessary calls to publish_stats_to_osd() in
the clear_pgscrub_state pathway used during interval changes. We didn't
actually have anything to publish and we can't validly call publish_stats_to_osd()
when we aren't an active primary anyway (which we can't be during an interval
change).
Fixes: https://tracker.ceph.com/issues/58496
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
(cherry picked from commit
aeff19db99ab53fbaec7eb530e35d578e6254e4c)