]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/volumes: access volume in lockless mode when fetching async job
authorVenky Shankar <vshankar@redhat.com>
Wed, 19 Feb 2020 12:31:40 +0000 (07:31 -0500)
committerVenky Shankar <vshankar@redhat.com>
Tue, 25 Feb 2020 04:08:35 +0000 (23:08 -0500)
commit9c455de61d72a5adef315c00e2b2c5abef671b56
treeac2671fd4e26044a7acde5cce22c31642194ea19
parent97ce2bd8ad4ac57d2dd62a5faab2652223f285a0
mgr/volumes: access volume in lockless mode when fetching async job

Saw a deadlock when deleting lot of subvolumes -- purge threads were
stuck in accessing global lock for volume access. This can happen
when there is a concurrent remove (which renames and signals the
purge threads) and a purge thread is just about to scan the trash
directory for entries.

For the fix, purge threads fetches entries by accessing the volume
in lockless mode. This is safe from functionality point-of-view as
the rename and directory scan is correctly handled by the filesystem.
Worst case the purge thread would pick up the trash entry on next
scan, never leaving a stale trash entry.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 808a1ce1f96f6dfd3472156ce5087372da4c1314)
src/pybind/mgr/volumes/fs/async_cloner.py
src/pybind/mgr/volumes/fs/purge_queue.py