From 430bca52e14563b01c7110916eba1b4316a01e63 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Sat, 23 May 2020 00:14:14 +0200 Subject: [PATCH] crimson/osd: introduce PGRecovery::start_backfill_recovery(). Signed-off-by: Radoslaw Zarzynski --- src/crimson/osd/pg_recovery.cc | 18 ++++++++++++------ src/crimson/osd/pg_recovery.h | 3 +++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/crimson/osd/pg_recovery.cc b/src/crimson/osd/pg_recovery.cc index ec25b3fe70f..a585e466a30 100644 --- a/src/crimson/osd/pg_recovery.cc +++ b/src/crimson/osd/pg_recovery.cc @@ -401,6 +401,17 @@ void PGRecovery::_committed_pushed_object(epoch_t epoch, } } +template +void PGRecovery::start_backfill_recovery(const EventT& evt) +{ + using BackfillRecovery = crimson::osd::BackfillRecovery; + std::ignore = pg->get_shard_services().start_operation( + static_cast(pg), + pg->get_shard_services(), + pg->get_osdmap_epoch(), + evt); +} + void PGRecovery::request_replica_scan( const pg_shard_t& target, const hobject_t& begin, @@ -465,10 +476,5 @@ void PGRecovery::on_backfill_reserved() std::make_unique(pg->get_peering_state()), std::make_unique( *static_cast(pg))); - using BackfillRecovery = crimson::osd::BackfillRecovery; - pg->get_shard_services().start_operation( - static_cast(pg), - pg->get_shard_services(), - pg->get_osdmap_epoch(), - BackfillState::Triggered{}); + start_backfill_recovery(BackfillState::Triggered{}); } diff --git a/src/crimson/osd/pg_recovery.h b/src/crimson/osd/pg_recovery.h index 67a87f12b1e..651becfed0f 100644 --- a/src/crimson/osd/pg_recovery.h +++ b/src/crimson/osd/pg_recovery.h @@ -83,6 +83,9 @@ private: // backfill begin std::unique_ptr backfill_state; + template + void start_backfill_recovery( + const EventT& evt); void request_replica_scan( const pg_shard_t& target, const hobject_t& begin, -- 2.39.5