]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/balancer: blame if upmap won't actually work 26497/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 14 Jan 2019 06:39:18 +0000 (14:39 +0800)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Tue, 19 Feb 2019 07:59:53 +0000 (14:59 +0700)
With automatic balancing on, and if mode is set to upmap,
balancer will fail silently if min_compat_client is lower than
luminous.
You can't figure out that unless you take a closer look at the
mgr log, which is super annoying..

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit c7356c66b0b0bb1a8a6197f84b26e6db0d192f60)

Conflicts:
- path: src/pybind/mgr/balancer/module.py
  comment: 'set_module_option()' -> 'set_config()' for mgr config-key

qa/suites/rados/thrash/d-balancer/upmap.yaml
src/pybind/mgr/balancer/module.py

index 417544a52c5d9587023c88e2db949b1d50c05b2b..788eebeeddd07a91eaedd2e074d59ffdb8e02c1c 100644 (file)
@@ -2,5 +2,6 @@ tasks:
 - exec:
     mon.a:
       - while ! ceph balancer status ; do sleep 1 ; done
+      - ceph osd set-require-min-compat-client luminous
       - ceph balancer mode upmap
       - ceph balancer on
index ff273a557f05916d3a4d7f6fe7c0e68d9d70c875..a183870899a5d3bd4dedff2852e065910edd65f5 100644 (file)
@@ -303,6 +303,14 @@ class Module(MgrModule):
             }
             return (0, json.dumps(s, indent=4), '')
         elif command['prefix'] == 'balancer mode':
+            if command['mode'] == 'upmap':
+                min_compat_client = self.get_osdmap().dump().get('require_min_compat_client', '')
+                if min_compat_client < 'luminous': # works well because version is alphabetized..
+                    warn = 'min_compat_client "%s" ' \
+                           '< "luminous", which is required for pg-upmap. ' \
+                           'Try "ceph osd set-require-min-compat-client luminous" ' \
+                           'before enabling this mode' % min_compat_client
+                    return (-errno.EPERM, '', warn)
             self.set_config('mode', command['mode'])
             return (0, '', '')
         elif command['prefix'] == 'balancer on':