]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: PeeringState: fix a boolean conditional direction
authorGreg Farnum <gfarnum@redhat.com>
Fri, 12 Mar 2021 21:05:29 +0000 (21:05 +0000)
committerGreg Farnum <gfarnum@redhat.com>
Mon, 15 Mar 2021 18:38:52 +0000 (18:38 +0000)
We want to add an OSD from the mandatory member if we DON'T already have one!

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit d7fac0550ae685d9f679263825d16f9e1537049f)

src/osd/PeeringState.cc

index 0f5f3f5b93e31f51500af3b73d135a628f4cf52b..2134b4cbe29f89da9b7f0b81eea62aab522dee47 100644 (file)
@@ -2038,7 +2038,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;
   }
@@ -2109,7 +2109,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);