From: Ilya Dryomov Date: Thu, 16 Jun 2022 17:10:32 +0000 (+0200) Subject: mgr/rbd_support: add logs for when there is no schedule and for descheduling X-Git-Tag: v18.0.0~653^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=568345b47503d8e69e6f7d074a0083fc5de44a2e;p=ceph.git mgr/rbd_support: add logs for when there is no schedule and for descheduling Signed-off-by: Ilya Dryomov --- diff --git a/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py b/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py index 4a8481ba1c6d..97f4bf236094 100644 --- a/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py +++ b/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py @@ -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(): diff --git a/src/pybind/mgr/rbd_support/trash_purge_schedule.py b/src/pybind/mgr/rbd_support/trash_purge_schedule.py index 042a529b8a64..e77049e756cc 100644 --- a/src/pybind/mgr/rbd_support/trash_purge_schedule.py +++ b/src/pybind/mgr/rbd_support/trash_purge_schedule.py @@ -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: