]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/balancer: skip CRUSH_ITEM_NONE 19023/head
authorSage Weil <sage@redhat.com>
Mon, 13 Nov 2017 01:49:02 +0000 (19:49 -0600)
committerPrashant D <pdhange@redhat.com>
Mon, 20 Nov 2017 01:51:44 +0000 (20:51 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit e2cbb4bc7a2badc3ff89fb4bf4d678d8e9f94652)

src/pybind/mgr/balancer/module.py
src/pybind/mgr/mgr_module.py

index 8078143907079b773ce4cb54c8f707b46a467512..8fddaa6866656344e9809c0308565e115c8d9db5 100644 (file)
@@ -11,6 +11,7 @@ import random
 import time
 from mgr_module import MgrModule, CommandResult
 from threading import Event
+from mgr_module import CRUSHMap
 
 # available modes: 'none', 'crush', 'crush-compat', 'upmap', 'osd_weight'
 default_mode = 'none'
@@ -19,7 +20,6 @@ default_max_misplaced = .05    # max ratio of pgs replaced at a time
 
 TIME_FORMAT = '%Y-%m-%d_%H:%M:%S'
 
-
 class MappingState:
     def __init__(self, osdmap, pg_dump, desc=''):
         self.desc = desc
@@ -451,6 +451,8 @@ class Module(MgrModule):
                     bytes_by_osd[osd] = 0
             for pgid, up in pm.iteritems():
                 for osd in [int(osd) for osd in up]:
+                    if osd == CRUSHMap.ITEM_NONE:
+                        continue
                     pgs_by_osd[osd] += 1
                     objects_by_osd[osd] += ms.pg_stat[pgid]['num_objects']
                     bytes_by_osd[osd] += ms.pg_stat[pgid]['num_bytes']
index 1abbcc5cd4fbe02c4fc635c3586ff6ed393b5972..77ffeea98cbf26387f3bd61446450497ab55f599 100644 (file)
@@ -126,6 +126,8 @@ class OSDMapIncremental(ceph_module.BasePyOSDMapIncremental):
         return self._set_crush_compat_weight_set_weights(weightmap)
 
 class CRUSHMap(ceph_module.BasePyCRUSH):
+    ITEM_NONE = 0x7fffffff
+
     def dump(self):
         return self._dump()