Skip to content

Commit cb10c0d

Browse files
author
Laura Flores
committed
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 <[email protected]>
1 parent 33b5f3d commit cb10c0d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/osd/OSDMap.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5143,6 +5143,12 @@ int OSDMap::balance_primaries(
51435143
num_changes++;
51445144
}
51455145
}
5146+
} else { // clear out any mappings that were made since the score didn't improve
5147+
for (auto [pg, mapped] : prim_pgs_to_check) {
5148+
if (mapped) {
5149+
pending_inc->new_pg_upmap_primary.erase(pg);
5150+
}
5151+
}
51465152
}
51475153

51485154
ldout(cct, 10) << __func__ << " num_changes " << num_changes << dendl;

0 commit comments

Comments
 (0)