]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: fix the pgs_per_weight calculation error when multiple pools 69637/head
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 24 Jun 2026 07:31:11 +0000 (15:31 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Wed, 24 Jun 2026 07:49:44 +0000 (15:49 +0800)
are being balanced

Before this commit, When multiple pools are being balanced,
pgs_per_weight only considers the last pool, which is wrong.

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/osd/OSDMap.cc

index 7579e054c8e98487f49e06f68d11d9ee3ebda1d7..a82cb3cea6885ecde7d9184883fe2f89d2e7e0d9 100644 (file)
@@ -6197,7 +6197,7 @@ float OSDMap::build_pool_pgs_info (
     }
     total_pgs += pdata.get_size() * pdata.get_pg_num();
 
-    osds_weight_total = get_osds_weight(cct, tmp_osd_map, pid, osds_weight);
+    osds_weight_total += get_osds_weight(cct, tmp_osd_map, pid, osds_weight);
   }
   for (auto& [oid, oweight] : osds_weight) {
     int pgs = 0;