Merge pull request #38206 from dvanders/dvanders_upmap

mgr/balancer: fix available pgs sent to calc_pg_upmaps

Reviewed-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
Kefu Chai 2020-11-27 14:15:47 +08:00 committed by GitHub
commit a1cbe293c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1005,10 +1005,8 @@ class Module(MgrModule):
random.shuffle(adjusted_pools)
pool_dump = osdmap_dump.get('pools', [])
for pool in adjusted_pools:
num_pg = 0
for p in pool_dump:
if p['pool_name'] == pool:
num_pg = p['pg_num']
pool_id = p['pool']
break
@ -1023,7 +1021,7 @@ class Module(MgrModule):
if s['state_name'] == 'active+clean':
num_pg_active_clean += s['count']
break
available = left - (num_pg - num_pg_active_clean)
available = min(left, num_pg_active_clean)
did = plan.osdmap.calc_pg_upmaps(inc, max_deviation, available, [pool])
total_did += did
left -= did