Bug 2280750 - mgr/stats: fix AttributeError in perf_stats.py --> re_register_queries()
Summary: mgr/stats: fix AttributeError in perf_stats.py --> re_register_queries()
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: CephFS
Version: 7.1
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
: 7.1z1
Assignee: Jos Collin
QA Contact: julpark
Akash Raj
URL:
Whiteboard:
Depends On: 2280743
Blocks: 2280748 2298577
TreeView+ depends on / blocked
 
Reported: 2024-05-16 06:08 UTC by Jos Collin
Modified: 2024-08-07 11:21 UTC (History)
7 users (show)

Fixed In Version: ceph-18.2.1-206.el9cp
Doc Type: Bug Fix
Doc Text:
Previously, whenever the stats plugin was enabled and a new fs was created, the fsmap observers were notified. Thus, `FSPerfStats:re_register_queries()` would be unexpectedly called, causing errors in mgr logs. With this fix, `self.mx_last_updated` in `FSPerfStats::init` is initialized, thereby solving the issue.
Clone Of: 2280743
Environment:
Last Closed: 2024-08-07 11:21:40 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 65983 0 None None None 2024-05-16 06:08:06 UTC
Red Hat Issue Tracker RHCEPH-9033 0 None None None 2024-05-16 06:08:37 UTC
Red Hat Product Errata RHBA-2024:5080 0 None None None 2024-08-07 11:21:51 UTC

Description Jos Collin 2024-05-16 06:08:07 UTC
+++ This bug was initially created as a clone of Bug #2280743 +++

Description of problem:
test_dumpfs passed but it shows below 
2024-03-20T21:38:38.702 INFO:tasks.ceph.mgr.x.smithi007.stderr:Exception in thread Thread-3:
2024-03-20T21:38:38.702 INFO:tasks.ceph.mgr.x.smithi007.stderr:Traceback (most recent call last):
2024-03-20T21:38:38.702 INFO:tasks.ceph.mgr.x.smithi007.stderr:  File "/usr/lib64/python3.9/threading.py", line 980, in _bootstrap_inner
2024-03-20T21:38:38.704 DEBUG:teuthology.orchestra.run.smithi007:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 120 ceph --cluster ceph osd pool get cephfs_data pg_num
2024-03-20T21:38:38.712 INFO:tasks.ceph.mgr.x.smithi007.stderr:    self.run()
2024-03-20T21:38:38.712 INFO:tasks.ceph.mgr.x.smithi007.stderr:  File "/usr/lib64/python3.9/threading.py", line 1306, in run
2024-03-20T21:38:38.712 INFO:tasks.ceph.mgr.x.smithi007.stderr:    self.function(*self.args, **self.kwargs)
2024-03-20T21:38:38.712 INFO:tasks.ceph.mgr.x.smithi007.stderr:  File "/usr/share/ceph/mgr/stats/fs/perf_stats.py", line 222, in re_register_queries
2024-03-20T21:38:38.713 INFO:tasks.ceph.mgr.x.smithi007.stderr:    if self.mx_last_updated >= ua_last_updated:
2024-03-20T21:38:38.713 INFO:tasks.ceph.mgr.x.smithi007.stderr:AttributeError: 'FSPerfStats' object has no attribute 'mx_last_updated'

This happens because of the new fs creation from qa -> test_dumpfs(). When the stats plugin is enabled and we create a new fs, the fsmap observers are getting notified. Thus FSPerfStats:re_register_queries() is getting called, which was not expected, but self.mx_last_updated was initialised only when 'perf stats' processes an mds report. 

Version-Release number of selected component (if applicable):


How reproducible:
Reproduced by the qa tests.

Steps to Reproduce:
(Look at test_dumpfs(): https://github.com/ceph/ceph/blob/main/qa/tasks/cephfs/test_fstop.py#L93)
1. enable mgr/stats plugin
2. Create a filesystem, mount on 2 clients.
3. Before executing 'perf stats', unmount one client and create a second filesystem. Then mount the second filesytem and continue with `perf stats` querying.
4. AttributeError: 'FSPerfStats' object has no attribute 'mx_last_updated'

Actual results:
The mgr logs shows AttributeError: 'FSPerfStats' object has no attribute 'mx_last_updated'

Expected results:
AttributeError should not appear in the mgr logs.

Additional info:

Comment 7 errata-xmlrpc 2024-08-07 11:21:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 7.1 security and bug fix update.), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2024:5080


Note You need to log in before you can comment on or make changes to this bug.