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 2280750

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: julpark
Severity: medium Docs Contact: Akash Raj <akraj>
Priority: high    
Version: 7.1CC: akraj, ceph-eng-bugs, cephqe-warriors, gfarnum, hyelloji, julpark, tserlin
Target Milestone: ---   
Target Release: 7.1z1   
Hardware: All   
OS: Linux   
Whiteboard:
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.
Story Points: ---
Clone Of: 2280743 Environment:
Last Closed: 2024-08-07 11:21:40 UTC Type: ---
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: 2280743    
Bug Blocks: 2280748, 2298577    

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