From cb10c0d82127eb46529283b71f5e04b2f72e2cda Mon Sep 17 00:00:00 2001 From: Laura Flores Date: Fri, 26 Jan 2024 17:32:43 +0000 Subject: [PATCH] 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 --- src/osd/OSDMap.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 5773695b77ad3..4cd9bff444169 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; -- 2.39.5