From 06e44be9986e7598f557d9646d7f93c9db4bc89d Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 18 Jun 2019 00:37:59 -0400 Subject: [PATCH] mgr / volumes: schedule purge job for volumes on init So as to kickstart leftover subvolume purges. Signed-off-by: Venky Shankar --- src/pybind/mgr/volumes/fs/volume.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pybind/mgr/volumes/fs/volume.py b/src/pybind/mgr/volumes/fs/volume.py index 37d82402acf..b2d72d7d06b 100644 --- a/src/pybind/mgr/volumes/fs/volume.py +++ b/src/pybind/mgr/volumes/fs/volume.py @@ -163,6 +163,14 @@ class VolumeClient(object): self.connection_pool = ConnectionPool(self.mgr) # TODO: make thread pool size configurable self.purge_queue = ThreadPoolPurgeQueueMixin(self, 4) + # on startup, queue purge job for available volumes to kickstart + # purge for leftover subvolume entries in trash. note that, if the + # trash directory does not exist or if there are no purge entries + # available for a volume, the volume is removed from the purge + # job list. + fs_map = self.mgr.get('fs_map') + for fs in fs_map['filesystems']: + self.purge_queue.queue_purge_job(fs['mdsmap']['fs_name']) def gen_pool_names(self, volname): """ -- 2.39.5