Bug 1645603

Summary: dmstats report never displays report data
Product: Red Hat Enterprise Linux 7 Reporter: Bryn M. Reeves <bmr>
Component: lvm2Assignee: Bryn M. Reeves <bmr>
lvm2 sub component: dmsetup QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: high CC: agk, bgurney, bmr, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, msuchane, prajnoha, prockai, rhandlin, zkabelac
Version: 7.6Keywords: Patch, Regression, ZStream
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.184-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Previously, the "dmstats report" command did not print statistics for any registered regions. With this update, the problem has been fixed, and the "dmstats report" command now lists all registered regions correctly.
Story Points: ---
Clone Of:
: 1645617 1647718 (view as bug list) Environment:
Last Closed: 2019-08-06 13:10:41 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: 1645617, 1647718    

Description Bryn M. Reeves 2018-11-02 15:43:48 UTC
Description of problem:
When one or more dmstats regions exist on any device mapper device, the 'dmstats report' command should print a row of output for each registered region. 

A regression in dmsetup's _display_info_cols() causes statistics reports to skip all rows of output due to an incorrect use of the dm_stats_get_nr_regions() function: this can only be used on a bound handle that has already been initialised with data from the kernel. When called on an unbound or uninitialised handle, it will always return zero, causing the reporting code to assume there are never any regions to report, and to skip every device in the output.

Version-Release number of selected component (if applicable):
lvm2-2.02.180-*.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. dmstats create --alldevices
2. dmstats report

Actual results:
No output rows after header.

Expected results:
One row of output per existing dm device

Additional info:
Fixed upstream in two commits:

613466aa8 dmsetup: fix stats report command output
813a83b2d libdm-stats: move no regions warning after dm_stats_list()

Comment 3 Corey Marthaler 2018-11-07 19:32:32 UTC
FWIW: It appears this was brought up in bug 1596129.

https://bugzilla.redhat.com/show_bug.cgi?id=1596129#c16

Comment 8 Corey Marthaler 2019-05-30 18:50:54 UTC
Fix verified in the latest rpms.

[root@hayes-03 ~]# df -h
Filesystem                                                Size  Used Avail Use% Mounted on
/dev/mapper/black_bird-non_synced_primary_raid10_3legs_1  9.8G   66M  9.2G   1% /mnt/non_synced_primary_raid10_3legs_1

May 30 13:43:10 hayes-03 qarshd[35593]: Running cmdline: dmstats create --filemap /mnt/non_synced_primary_raid10_3legs_1/hayes-03_load

May 30 13:43:10 hayes-03 qarshd[35599]: Running cmdline: dmstats create black_bird-non_synced_primary_raid10_3legs_1

# Do I/O
May 30 13:43:11 hayes-03 qarshd[35603]: Running cmdline: /usr/tests/sts-rhel7.7/bin/checkit -w /mnt/non_synced_primary_raid10_3legs_1/checkit -f /tmp/checkit_non_synced_primary_raid10_3legs_1 -v

May 30 13:43:12 hayes-03 qarshd[35607]: Running cmdline: dmstats report

[root@hayes-03 ~]# dmstats report
Name                                         GrpID RgID ObjType ArID ArStart ArSize  RMrg/s WMrg/s R/s  W/s    RSz/s WSz/s  AvgRqSz QSize Util%  AWait RdAWait WrAWait
hayes-03_load                                    0    0 area       0 133.00m 980.00k   0.00   0.00 0.00 288.00     0 17.23m  61.00k  2.67  74.60  9.27    0.00    9.27
black_bird-non_synced_primary_raid10_3legs_1     -    1 area       0       0  10.01g   0.00   0.00 0.00 363.00     0 17.52m  49.00k  3.57 100.00  9.84    0.00    9.84
hayes-03_load                                    0    0 group      0 133.00m 980.00k   0.00   0.00 0.00 288.00     0 17.23m  61.00k  2.67  74.60  9.27    0.00    9.27


3.10.0-1046.el7.x86_64

lvm2-2.02.185-1.el7    BUILT: Mon May 13 04:36:30 CDT 2019
lvm2-libs-2.02.185-1.el7    BUILT: Mon May 13 04:36:30 CDT 2019
lvm2-lockd-2.02.185-1.el7    BUILT: Mon May 13 04:36:30 CDT 2019
device-mapper-1.02.158-1.el7    BUILT: Mon May 13 04:36:30 CDT 2019
device-mapper-libs-1.02.158-1.el7    BUILT: Mon May 13 04:36:30 CDT 2019
device-mapper-event-1.02.158-1.el7    BUILT: Mon May 13 04:36:30 CDT 2019
device-mapper-event-libs-1.02.158-1.el7    BUILT: Mon May 13 04:36:30 CDT 2019
device-mapper-persistent-data-0.8.1-1.el7    BUILT: Sat May  4 14:53:53 CDT 2019

Comment 10 errata-xmlrpc 2019-08-06 13:10:41 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, 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-2019:2253