]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/volumes: Fix clone hang issue
authorKotresh HR <khiremat@redhat.com>
Thu, 7 Apr 2022 13:28:28 +0000 (18:58 +0530)
committerKotresh HR <khiremat@redhat.com>
Wed, 13 Apr 2022 08:56:24 +0000 (14:26 +0530)
commitcfd8d63e0158b1d336f5e080a1e83dbf6fc60079
treed56b77e221c6318effbd3b807e7c3b30430b4028
parent916a5981cf2912e2b5f318295cb1af83e34f9183
mgr/volumes: Fix clone hang issue

Following sequence of operation lead to deadlock

1. Created subvolume
2. Written some I/O on the subvolume
3. Create snapshot of the subvolume
4. Create clone of the snapshot
5. Delete snapshot from back end (don't use subvolume interface) before
   clone completes
6. Delete clone with force
7. Delete subvolume
8. Delete fs and associated pools
9. Created new fs
10 Created new subvolume,
11. Written some I/O on the subvolume
12. Create snapshot of the subvolume
13. Create clone of the snapshot <---------------THIS OPERATION HANGS -----------------

Root Cause:
Since the snapshot is deleted from the back end, the clone fails. But it
also fails to remove the clone index at '/volumes/_index/clone'. The
cloner thread goes to infinite loop of starting the clone and failing.
This involves taking 'self.async_job.lock()' and reads the clone index
to get the job and registers the above job.

While the 'cloner thread' is in above loop, the fs is destroyed. The
cloner threads which lives till the mgr/volumes is enabled in mgr, takes
the 'self.async_job.lock()' and hangs while reading the clone index.

Any further clone operations which also requires above lock hangs.

Fix:
Remove the clone index even though snapshot is not present.

Fixes: https://tracker.ceph.com/issues/55217
Signed-off-by: Kotresh HR <khiremat@redhat.com>
src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py