From d7fac0550ae685d9f679263825d16f9e1537049f Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 12 Mar 2021 21:05:29 +0000 Subject: [PATCH] osd: PeeringState: fix a boolean conditional direction We want to add an OSD from the mandatory member if we DON'T already have one! Signed-off-by: Greg Farnum --- src/osd/PeeringState.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 7296e0647cf..e0f13adb56f 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -2024,7 +2024,7 @@ void PeeringState::calc_replicated_acting_stretch( } } - if (want->size() >= pool.info.size) { + if (want->size() >= pool.info.size) { // non-failed CRUSH mappings are valid ss << " up set sufficient" << std::endl; return; } @@ -2095,7 +2095,7 @@ void PeeringState::calc_replicated_acting_stretch( if (pool.info.peering_crush_mandatory_member != CRUSH_ITEM_NONE) { auto aiter = ancestors.find(pool.info.peering_crush_mandatory_member); if (aiter != ancestors.end() && - aiter->second.get_num_selected()) { + !aiter->second.get_num_selected()) { ss << " adding required ancestor " << aiter->first << std::endl; ceph_assert(!aiter->second.is_empty()); // wouldn't exist otherwise pop_ancestor(aiter->second); -- 2.39.5