From 151d9b8895b5c48ff6882c077d8a2734a4ee7d0b Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Mon, 14 Dec 2020 18:54:11 +0100 Subject: [PATCH] crimson/osd: recover_missing() doesn't return std::optional anymore. Signed-off-by: Radoslaw Zarzynski --- src/crimson/osd/osd_operations/background_recovery.cc | 6 +++--- src/crimson/osd/pg_recovery.cc | 11 +++-------- src/crimson/osd/pg_recovery.h | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/crimson/osd/osd_operations/background_recovery.cc b/src/crimson/osd/osd_operations/background_recovery.cc index 5a19c71b68d22..126e0e9029bff 100644 --- a/src/crimson/osd/osd_operations/background_recovery.cc +++ b/src/crimson/osd/osd_operations/background_recovery.cc @@ -64,9 +64,9 @@ seastar::future<> BackgroundRecovery::start() seastar::future UrgentRecovery::do_recovery() { if (!pg->has_reset_since(epoch_started)) { - auto futopt = pg->get_recovery_handler()->recover_missing(soid, need); - assert(futopt); - return with_blocking_future(std::move(*futopt)).then([] { + return with_blocking_future( + pg->get_recovery_handler()->recover_missing(soid, need) + ).then([] { return seastar::make_ready_future(false); }); } diff --git a/src/crimson/osd/pg_recovery.cc b/src/crimson/osd/pg_recovery.cc index 1ef692783e7c2..0eeeee2b82dd7 100644 --- a/src/crimson/osd/pg_recovery.cc +++ b/src/crimson/osd/pg_recovery.cc @@ -151,13 +151,8 @@ size_t PGRecovery::start_primary_recovery_ops( if (pg->get_recovery_backend()->is_recovering(head)) { ++skipped; } else { - auto futopt = recover_missing(soid, item.need); - if (futopt) { - out->push_back(std::move(*futopt)); - ++started; - } else { - ++skipped; - } + out->push_back(recover_missing(soid, item.need)); + ++started; } } @@ -257,7 +252,7 @@ size_t PGRecovery::start_replica_recovery_ops( return started; } -std::optional> PGRecovery::recover_missing( +crimson::osd::blocking_future<> PGRecovery::recover_missing( const hobject_t &soid, eversion_t need) { if (pg->get_peering_state().get_missing_loc().is_deleted(soid)) { diff --git a/src/crimson/osd/pg_recovery.h b/src/crimson/osd/pg_recovery.h index 54f3744bcec1c..86f259de54234 100644 --- a/src/crimson/osd/pg_recovery.h +++ b/src/crimson/osd/pg_recovery.h @@ -40,7 +40,7 @@ private: std::vector get_replica_recovery_order() const { return pg->get_replica_recovery_order(); } - std::optional> recover_missing( + crimson::osd::blocking_future<> recover_missing( const hobject_t &soid, eversion_t need); size_t prep_object_replica_deletes( const hobject_t& soid, -- 2.39.5