]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix regression in activate
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 21 Sep 2022 20:25:04 +0000 (22:25 +0200)
committerYuri Weinstein <yweinste@redhat.com>
Wed, 5 Apr 2023 22:33:42 +0000 (22:33 +0000)
bea9f4b643c introduced a regression that makes the activate process
take a very long time to complete.
`_get_bluestore_info()` which calls `ceph-bluestore-tool` binary via
subprocess is called in an exponential way while this is not needed.

Fixes: https://tracker.ceph.com/issues/57627
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 8d7423c3e75afbe111c91e699ef3cb1c0beee61b)
(cherry picked from commit d322bb891dbaf420dd1d1d32d4ce3e8582bd715b)

src/ceph-volume/ceph_volume/devices/raw/list.py

index 06a2b3c2240876f18ec5149ec7314975b03493a9..a9eb413120df4a2214be03217ac19058ce27c294 100644 (file)
@@ -101,16 +101,16 @@ class List(object):
                                     'failed to determine if parent device {} is BlueStore. err: {}'.format(parent, e)))
                         continue
 
-                bs_info = _get_bluestore_info(dev)
-                if bs_info is None:
-                    # None is also returned in the rare event that there is an issue reading info from
-                    # a BlueStore disk, so be sure to log our assumption that it isn't bluestore
-                    logger.info('device {} does not have BlueStore information'.format(dev))
-                    continue
-                uuid = bs_info['osd_uuid']
-                if uuid not in result:
-                    result[uuid] = {}
-                result[uuid].update(bs_info)
+            bs_info = _get_bluestore_info(dev)
+            if bs_info is None:
+                # None is also returned in the rare event that there is an issue reading info from
+                # a BlueStore disk, so be sure to log our assumption that it isn't bluestore
+                logger.info('device {} does not have BlueStore information'.format(dev))
+                continue
+            uuid = bs_info['osd_uuid']
+            if uuid not in result:
+                result[uuid] = {}
+            result[uuid].update(bs_info)
 
         return result