Skip to content

Commit

Permalink
mgr/balancer: create compat weight-set earlier
Browse files Browse the repository at this point in the history
So if we do:

ceph balancer mode crush-compat
ceph balancer on
ceph config set global osd_crush_update_weight_set false

and then add some new osd in, those osds will truly start
with a zeroed weight-set weight.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit f73bd45)
  • Loading branch information
xiexingguo committed May 29, 2019
1 parent ce18684 commit 11cd731
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pybind/mgr/balancer/module.py
Expand Up @@ -426,6 +426,11 @@ def handle_command(self, inbuf, command):
'Try "ceph osd set-require-min-compat-client luminous" ' \
'before enabling this mode' % min_compat_client
return (-errno.EPERM, '', warn)
elif command['mode'] == 'crush-compat':
ms = MappingState(self.get_osdmap(),
self.get("pg_dump"),
'initialize compat weight-set')
self.get_compat_weight_set_weights(ms) # ignore error
self.set_module_option('mode', command['mode'])
return (0, '', '')
elif command['prefix'] == 'balancer on':
Expand Down

0 comments on commit 11cd731

Please sign in to comment.