]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Mon, 24 Feb 2020 09:27:02 +0000 (04:27 -0500)
commit808a1ce1f96f6dfd3472156ce5087372da4c1314
treea6a153e1f03894018039720a896a28b255a19d78
parent7ee72754847d377ba45c2383f2b12d51232df9c6
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>
src/pybind/mgr/volumes/fs/async_cloner.py
src/pybind/mgr/volumes/fs/purge_queue.py