]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rbd_support: bail from refresh_pools() when there is no schedule
authorIlya Dryomov <idryomov@gmail.com>
Thu, 16 Jun 2022 17:23:58 +0000 (19:23 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 21 Jun 2022 15:30:18 +0000 (17:30 +0200)
Make refresh_pools() behave the same as refresh_images().

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 7d1e644b62909fb3844c0559f5ea94419eae6864)

Conflicts:
src/pybind/mgr/rbd_support/trash_purge_schedule.py [ commit
  e4a16e261370 ("mgr/rbd_support: add type annotation") not in
  octopus ]

src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py
src/pybind/mgr/rbd_support/trash_purge_schedule.py

index 219a44e6dc1d827d7a98b7306ea44a6f4eacb53b..d41d7b1c402dff94bb0b56ce21f4574dbfd7f74d 100644 (file)
@@ -485,6 +485,7 @@ class MirrorSnapshotScheduleHandler:
 
         with self.lock:
             if not self.schedules:
+                self.log.debug("MirrorSnapshotScheduleHandler: no schedules")
                 self.watchers.unregister_all()
                 self.images = {}
                 self.queue = {}
index 106e8e649d4263dfc374f74eee6a68ea7ebb1ee9..a1ab4f881dba76c1ea97bd189882544a86c203f6 100644 (file)
@@ -81,6 +81,14 @@ class TrashPurgeScheduleHandler:
 
         self.load_schedules()
 
+        with self.lock:
+            if not self.schedules:
+                self.log.debug("TrashPurgeScheduleHandler: no schedules")
+                self.pools = {}
+                self.queue = {}
+                self.last_refresh_pools = datetime.now()
+                return
+
         pools = {}
 
         for pool_id, pool_name in get_rbd_pools(self.module).items():