Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
This project is now read‑only. Starting Monday, February 2, please use https://ibm-ceph.atlassian.net/ for all bug tracking management.

Bug 2280743

Summary: mgr/stats: fix AttributeError in perf_stats.py --> re_register_queries()
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Jos Collin <jcollin>
Component: CephFSAssignee: Jos Collin <jcollin>
Status: CLOSED ERRATA QA Contact: Hemanth Kumar <hyelloji>
Severity: medium Docs Contact:
Priority: high    
Version: 6.1CC: ceph-eng-bugs, cephqe-warriors, gfarnum, hyelloji, jcaratza, rpollack, tserlin, vshankar
Target Milestone: ---Flags: hyelloji: needinfo+
Target Release: 6.1z7   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ceph-17.2.6-234 Doc Type: Bug Fix
Doc Text:
.FSPerfStats:re_register_queries() is no longer called unexpectedly when creating new file systems Previously, whenever the stats plugin was enabled and a new File System was created, the fsmap observers were notified. As a result, 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, and errors no longer occur in the mgr logs.
Story Points: ---
Clone Of:
: 2280748 2280750 (view as bug list) Environment:
Last Closed: 2024-08-28 17:58:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2280748, 2280750    

Description Jos Collin 2024-05-16 05:05:19 UTC
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 6 errata-xmlrpc 2024-08-28 17:58:19 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 6.1 security, bug fix, and enhancement updates.), 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:5960