]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rbd_support: add logs for when there is no schedule and for descheduling
authorIlya Dryomov <idryomov@gmail.com>
Thu, 16 Jun 2022 17:10:32 +0000 (19:10 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 17 Jun 2022 14:20:26 +0000 (16:20 +0200)
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py
src/pybind/mgr/rbd_support/trash_purge_schedule.py

index 4a8481ba1c6d2d4b6789a8f596291b331653fc6d..97f4bf23609434da645267419600537955834830 100644 (file)
@@ -634,9 +634,11 @@ class MirrorSnapshotScheduleHandler:
         self.condition.notify()
 
     def enqueue(self, now: datetime, pool_id: str, namespace: str, image_id: str) -> None:
-
         schedule = self.schedules.find(pool_id, namespace, image_id)
         if not schedule:
+            self.log.debug(
+                "MirrorSnapshotScheduleHandler: no schedule for {}/{}/{}".format(
+                    pool_id, namespace, image_id))
             return
 
         schedule_time = schedule.next_run(now)
@@ -668,6 +670,10 @@ class MirrorSnapshotScheduleHandler:
         return image, 0.0
 
     def remove_from_queue(self, pool_id: str, namespace: str, image_id: str) -> None:
+        self.log.debug(
+            "MirrorSnapshotScheduleHandler: descheduling {}/{}/{}".format(
+                pool_id, namespace, image_id))
+
         empty_slots = []
         image_spec = ImageSpec(pool_id, namespace, image_id)
         for schedule_time, images in self.queue.items():
index 042a529b8a64e5ff16a71aed32a451355c508647..e77049e756cc367a3640f7aa7f7450760b50acf8 100644 (file)
@@ -154,9 +154,11 @@ class TrashPurgeScheduleHandler:
         self.condition.notify()
 
     def enqueue(self, now: datetime, pool_id: str, namespace: str) -> None:
-
         schedule = self.schedules.find(pool_id, namespace)
         if not schedule:
+            self.log.debug(
+                "TrashPurgeScheduleHandler: no schedule for {}/{}".format(
+                    pool_id, namespace))
             return
 
         schedule_time = schedule.next_run(now)
@@ -188,6 +190,10 @@ class TrashPurgeScheduleHandler:
         return namespace, 0.0
 
     def remove_from_queue(self, pool_id: str, namespace: str) -> None:
+        self.log.debug(
+            "TrashPurgeScheduleHandler: descheduling {}/{}".format(
+                pool_id, namespace))
+
         empty_slots = []
         for schedule_time, namespaces in self.queue.items():
             if (pool_id, namespace) in namespaces: