From 61a1a2a526c3fcd937e11a7e32f1e53e4fdf12bc Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 19 Sep 2023 15:05:07 -0700 Subject: [PATCH] PeeringState: introduce optional on_replica_activate notification The OSD will use it to activate the scrubber in replica mode. Signed-off-by: Samuel Just --- src/osd/PeeringState.cc | 2 ++ src/osd/PeeringState.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 2c41b7b7118..c81cb958a7a 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -2967,6 +2967,8 @@ void PeeringState::activate( state_set(PG_STATE_ACTIVATING); pl->on_activate(std::move(to_trim)); + } else { + pl->on_replica_activate(); } if (acting_set_writeable()) { PGLog::LogEntryHandlerRef rollbacker{pl->get_log_handler(t)}; diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index b9f8401b05b..89ef702e0fe 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -389,6 +389,7 @@ public: virtual void on_role_change() = 0; virtual void on_change(ObjectStore::Transaction &t) = 0; virtual void on_activate(interval_set to_trim) = 0; + virtual void on_replica_activate() {} virtual void on_activate_complete() = 0; virtual void on_new_interval() = 0; virtual Context *on_clean() = 0; -- 2.39.5