]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd/OSDMap: skip upmap-items drop when um_from would become equally overfull
authorHu-Yuxuan <1024252105@qq.com>
Mon, 9 Oct 2023 09:49:54 +0000 (17:49 +0800)
committerKefu Chai <k.chai@proxmox.com>
Wed, 6 May 2026 04:33:58 +0000 (12:33 +0800)
commit2ba9e1da7c3b767e3d34b5238508bb78e2f064f5
treed020a613bce764f0c1d0c347b99a669f7aff5ca8
parent6666bacf8290e88fe67a9357f37a594572f91fc2
osd/OSDMap: skip upmap-items drop when um_from would become equally overfull

Improves pg-upmap balancer convergence speed on clusters where many OSDs
are mutually overfull and linked by pg_upmap_items -- a common pattern
after a scale-up that increases replica count.

When try_drop_remap_overfull finds an incoming [um_from -> osd] pair on an
overfull osd, it called test_change to check whether dropping the pair would
improve distribution.  If um_from carries the same excess load as osd,
though, dropping just returns the PG to an equally crowded OSD -- test_change
rejects the move anyway.  With many such mutual pairs, the wasted calls add
up to minutes before the balancer gives up.

This adds an early check: skip test_change when um_from would end up at
least as overfull as osd after receiving the PG back.  This eliminates
O(n_cohort * R) wasted test_change calls per balancer pass and reduces
calc_pg_upmaps from minutes to milliseconds in the affected scenario.

Fixes: https://tracker.ceph.com/issues/63137
Signed-off-by: Hu-Yuxuan <1024252105@qq.com>
Co-authored-by: Kefu Chai <k.chai@proxmox.com>
src/osd/OSDMap.cc
src/osd/OSDMap.h
src/test/osd/TestOSDMap.cc