From: Laura Flores Date: Fri, 26 Jan 2024 17:32:43 +0000 (+0000) Subject: osd: clear out unneeded pending pg-upmap-primary mappings X-Git-Tag: v19.3.0~143^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53988%2Fhead;p=ceph.git osd: clear out unneeded pending pg-upmap-primary mappings If the score did not improve, we should clear out any pending pg-upmap-primary mappings so they don't execute in situations where the same incremental is used to balance multiple pools (i.e. in the balancer mgr module). Signed-off-by: Laura Flores --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 5773695b77ad..4cd9bff44416 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -5143,6 +5143,12 @@ int OSDMap::balance_primaries( num_changes++; } } + } else { // clear out any mappings that were made since the score didn't improve + for (auto [pg, mapped] : prim_pgs_to_check) { + if (mapped) { + pending_inc->new_pg_upmap_primary.erase(pg); + } + } } ldout(cct, 10) << __func__ << " num_changes " << num_changes << dendl;