]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/balancer: blame if upmap won't actually work 26498/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 14 Jan 2019 06:39:18 +0000 (14:39 +0800)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Wed, 24 Jul 2019 02:20:01 +0000 (09:20 +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: qa/suites/rados/thrash/d-balancer/upmap.yaml
  comment: changeset here -> qa/suites/rados/thrash/d-require-luminous/at-mkfs-balancer-upmap.yaml
- path: src/pybind/mgr/balancer/module.py
  comment: 'set_module_option()' -> 'set_config()' for mgr config-key

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

index a1e0afea0650ac4f7b8cbe48bb9fbd9396ea54c7..a6a11c4dec0817e3640f45ee834804e75e933d18 100644 (file)
@@ -7,5 +7,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 75cdfe35ed885633c2e9157e9882aec49c3e1e7c..18d8b55f07b6d0d442f1035fc5b827b02137ea4c 100644 (file)
@@ -288,6 +288,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':