]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/vol: handle case where clone index entry goes missing 58557/head
authorRishabh Dave <ridave@redhat.com>
Mon, 17 Jun 2024 19:03:28 +0000 (00:33 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 12 Jul 2024 14:43:46 +0000 (20:13 +0530)
commitb0da2c37d24c89f4e80b68fd335cdd896e5fc17d
treefcd9b3534586e61ae3b3a3000b68fac483c7f704
parent9798a35879a78dcfc75ca4135ee87a4dd9ad5d28
mgr/vol: handle case where clone index entry goes missing

In `async_cloner.py`, clone index entry is fetched to get next clone job
that needs to be executed. It might happen that the clone job was
cancelled just when it was going to be picked for execution (IOW, when
it was about to move from pending state to in-progress state).

Currently, MGR hangs in such a case because exception `ObjectNotFound`
from CephFS Python bindings is raised and is left uncaught. To prevent
this issue catch the exception, log it and return None to tell
`get_job()` of `async_job.py` to look for next job in the queue.

Increase the scope of try-except in method `get_oldest_clone_entry()` of
`async_cloner.py` so that when exception `cephfs.Error` or any exception
under it is thrown by `self.fs.lstat()` is not left uncaught.

FS object is also passed to the method `list_one_entry_at_a_time()`, so
increasing scope of try-except is useful as it will not allow exceptions
raised in other calls to CephFS Python binding methods to be left
uncaught.

Fixes: https://tracker.ceph.com/issues/66560
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 3cff7251c86a4670768721f924b11b3de33f807b)
src/pybind/mgr/volumes/fs/operations/clone_index.py