From 76b5a0022d4734607543c85b6c7e2323da3892eb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 22 Aug 2019 10:19:25 -0500 Subject: [PATCH] osd/PeeringState: use return value from discover_all_missing Right now we tell whether discover_all_missing did something by looking at whether query_map is empty. Instead, use an explicit return value. Signed-off-by: Sage Weil --- src/osd/PG.cc | 3 +-- src/osd/PeeringState.cc | 5 ++++- src/osd/PeeringState.h | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 88d86957ad9eb..e4a85ed81e74f 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3617,8 +3617,7 @@ void PG::find_unfound(epoch_t queued, PeeringCtx &rctx) * It may be that our initial locations were bad and we errored * out while trying to pull. */ - recovery_state.discover_all_missing(rctx.query_map); - if (rctx.query_map.empty()) { + if (!recovery_state.discover_all_missing(rctx.query_map)) { string action; if (state_test(PG_STATE_BACKFILLING)) { auto evt = PGPeeringEventRef( diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 74c416f21fed5..006cbed605cd9 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -1980,11 +1980,12 @@ bool PeeringState::search_for_missing( return found_missing; } -void PeeringState::discover_all_missing( +bool PeeringState::discover_all_missing( map > &query_map) { auto &missing = pg_log.get_missing(); uint64_t unfound = get_num_unfound(); + bool any = false; // did we start any queries psdout(10) << __func__ << " " << missing.num_missing() << " missing, " @@ -2036,7 +2037,9 @@ void PeeringState::discover_all_missing( pg_query_t::FULLLOG, peer.shard, pg_whoami.shard, info.history, get_osdmap_epoch()); + any = true; } + return any; } /* Build the might_have_unfound set. diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index 790b32d35c6fd..ac5657952f803 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -1776,7 +1776,8 @@ public: const hobject_t soid); /// Pull missing sets from all candidate peers - void discover_all_missing(std::map > &query_map); + bool discover_all_missing( + map > &query_map); /// Notify that hoid has been fully recocovered void object_recovered( -- 2.39.5