Project

General

Profile

Actions

Bug #70941

open

mgr/vol: handle exception when lstat in list_entries_by_ctime_order fails

Added by Rishabh Dave 11 months ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

From /a/rishabh-2025-04-15_06:19:30-fs-wip-rishabh-testing-20250414.181222-debug-testing-default-smithi/8241738/teuthology.log -

2025-04-15T09:55:16.896 INFO:tasks.ceph.mgr.x.smithi112.stderr:Exception in thread Thread-19:
2025-04-15T09:55:16.896 INFO:tasks.ceph.mgr.x.smithi112.stderr:Traceback (most recent call last):
2025-04-15T09:55:16.896 INFO:tasks.ceph.mgr.x.smithi112.stderr:  File "/usr/lib64/python3.9/threading.py", line 980, in _bootstrap_inner
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:    self.run()
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:  File "/usr/share/ceph/mgr/mgr_util.py", line 98, in run
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:    self.function(*self.args, **self.kwargs)
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:  File "/usr/share/ceph/mgr/volumes/fs/stats_util.py", line 242, in _update_progress_bars
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:    clones = self._get_info_for_all_clones()
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:  File "/usr/share/ceph/mgr/volumes/fs/stats_util.py", line 177, in _get_info_for_all_clones
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:    clone_index_entries = clone_index.list_entries_by_ctime_order()
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:  File "/usr/share/ceph/mgr/volumes/fs/operations/clone_index.py", line 62, in list_entries_by_ctime_order
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:    stb = self.fs.lstat(d_path)
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:  File "cephfs.pyx", line 2011, in cephfs.LibCephFS.lstat
2025-04-15T09:55:16.911 INFO:tasks.ceph.mgr.x.smithi112.stderr:  File "cephfs.pyx", line 1992, in cephfs.LibCephFS.stat
2025-04-15T09:55:16.912 INFO:tasks.ceph.mgr.x.smithi112.stderr:cephfs.ObjectNotFound: error in stat: /volumes/_index/clone/f728f5a4-f2ec-4b34-bb9b-1c4be9781824: No such file or directory [Errno 2]

The lstat() call in following method raises cephfs.ObjectNotFound exceptipn which needs to be handled to avoid this crash -

    def list_entries_by_ctime_order(self):
        entry_names = listdir(self.fs, self.path, filter_files=False)
        if not entry_names:
            return []

        # clone entries with ctime obtained by statig them. basically,
        # following is a list of tuples where each tuple has 2 memebers.
        ens_with_ctime = []
        for en in entry_names:
            d_path = os.path.join(self.path, en)
            stb = self.fs.lstat(d_path)

            # add ctime next to clone entry
            ens_with_ctime.append((en, stb.st_ctime))

        ens_with_ctime.sort(key=lambda ctime: en[1])

        # remove ctime and return list of clone entries sorted by ctime.
        return [i[0] for i in ens_with_ctime]

No data to display

Actions

Also available in: Atom PDF