]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: clear out unneeded pending pg-upmap-primary mappings 53988/head
authorLaura Flores <lflores@ibm.com>
Fri, 26 Jan 2024 17:32:43 +0000 (17:32 +0000)
committerLaura Flores <lflores@ibm.com>
Sun, 28 Jan 2024 19:15:49 +0000 (13:15 -0600)
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 <lflores@ibm.com>
src/osd/OSDMap.cc

index 5773695b77ad30dcdfb8ba22aa6740e576d9f597..4cd9bff444169a311f37e6fde3365bceab8cce48 100644 (file)
@@ -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;