]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr / volumes: schedule purge job for volumes on init
authorVenky Shankar <vshankar@redhat.com>
Tue, 18 Jun 2019 04:37:59 +0000 (00:37 -0400)
committerVenky Shankar <vshankar@redhat.com>
Mon, 8 Jul 2019 03:58:16 +0000 (23:58 -0400)
So as to kickstart leftover subvolume purges.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/pybind/mgr/volumes/fs/volume.py

index 37d82402acf21ab9e1cdc720342b97293ac9b788..b2d72d7d06bf16583018ae9b3e9dae912e42e19c 100644 (file)
@@ -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):
         """