mgr/volumes: maintain per subvolume trash directory
authorVenky Shankar <vshankar@redhat.com>
Fri, 21 Aug 2020 14:07:37 +0000 (10:07 -0400)
committerShyamsundar Ranganathan <srangana@redhat.com>
Wed, 26 Aug 2020 17:40:51 +0000 (13:40 -0400)
commitaae7a70ed2cf9c32684cfdaf701778a05f229e09
tree9a798c714aacfd77249f10e2760d4575085cd8b2
parent9a76c01536377737a18ed7005fd10b1111e96d50
mgr/volumes: maintain per subvolume trash directory

PR https://github.com/ceph/ceph/pull/36472 introduces changes
that disallow nested nested snapshots in a subtree (subvolume)
and renames across subvolumes. This effect asynchronous purge
in mgr/volumes as subvolume are moved to a trash directory for
asynchronous deletion by purge threads.

To workaround this, start maintaining a subvolume specific
trash directory. Use the trash directory as an index to the
subvolume specific trash directory entry.

This changes subvolume deletion logic which currently relies
on `--retain-snapshots` flag to decide if the subvolume user
directory should get purged or the subvolume base directory
itself. Deleting a subvolume moves the user facing directory
to its specific trash directory. Purge threads take care of
deleting user facing directories (in trash) and the subvolume
base directory if required (when certain conditions are met).

Fixes: https://tracker.ceph.com/issues/47154
Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/pybind/mgr/volumes/fs/operations/resolver.py
src/pybind/mgr/volumes/fs/operations/trash.py
src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py
src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py
src/pybind/mgr/volumes/fs/purge_queue.py