diff --git a/src/v/raft/consensus.cc b/src/v/raft/consensus.cc index c1a197b6ef021..ed8082bfdad6f 100644 --- a/src/v/raft/consensus.cc +++ b/src/v/raft/consensus.cc @@ -3846,4 +3846,13 @@ void consensus::upsert_recovery_state( } } +std::optional consensus::get_learner_start_offset() const { + const auto& latest_cfg = _configuration_manager.get_latest(); + + if (latest_cfg.get_configuration_update()) { + return latest_cfg.get_configuration_update()->learner_start_offset; + } + return std::nullopt; +} + } // namespace raft diff --git a/src/v/raft/consensus.h b/src/v/raft/consensus.h index 5b7b9fffde981..ec073ebb5d93b 100644 --- a/src/v/raft/consensus.h +++ b/src/v/raft/consensus.h @@ -752,6 +752,8 @@ class consensus { model::offset leader_last_offset, bool already_recovering); + std::optional get_learner_start_offset() const; + bool use_serde_configuration() const { return _features.is_active(features::feature::raft_config_serde); }