Bug 1762302

Summary: foreman-maintain leaves fio test-files after running disk-benchmark
Product: Red Hat Satellite Reporter: Andreas Bleischwitz <ableisch>
Component: Satellite MaintainAssignee: Kavita <kgaikwad>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: akjha, apatel, francesco.trentini, inecas, kgaikwad, mbacovsk
Target Milestone: 6.8.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-0.5.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 12:38:20 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:

Description Andreas Bleischwitz 2019-10-16 13:09:11 UTC
Description of problem:
After running foreman-maintain, /var/lib/pulp/job1.0.0 is still on the disk. This file was created by the fio disk-benchmark.

fio --name=job1 --rw=read --size=1g --output-format=json --directory=/var/lib/pulp --direct=1

# ls -lh /var/lib/pulp/job1.0.0 
-rw-r--r--. 1 root root 1.0G Oct 16 12:51 /var/lib/pulp/job1.0.0

Version-Release number of selected component (if applicable):
# rpm -qa |grep maintain
rubygem-foreman_maintain-0.3.5-1.el7sat.noarch
satellite-maintain-0.0.1-1.el7sat.noarch


How reproducible:
Always

Steps to Reproduce:
1. run "foreman-maintain health check --label disk-performance"
2. see "/var/lib/pulp/job1.0.0" created, but never removed
3.

Actual results:
Leftovers from those benchmark tests.

Expected results:
Leftovers removed after benchmark has been run

Additional info:

/usr/share/gems/gems/foreman_maintain-0.3.5/lib/foreman_maintain/utils/disk/io_device.rb should probably add a file-removal after fio finished.

     28         def fio
     29           cmd = "fio --name=job1 --rw=read --size=1g --output-format=json\
     30                   --directory=#{dir} --direct=1"
     31           stdout = execute(cmd)
     32           output = JSON.parse(stdout)
     33           @fio ||= output['jobs'].first['read']['bw'].to_i
>> probably here??
     34         end

Additional, I see that /usr/share/gems/gems/foreman_maintain-0.3.5/definitions/checks/disk/performance.rb should test pulp, mongo and pgsql directories for speed, I only saw pulp being tested.

     17       DEFAULT_DIRS   = ['/var/lib/pulp', '/var/lib/mongodb', '/var/lib/pgsql'].freeze

Comment 6 Kavita 2019-11-01 17:50:12 UTC
Created redmine issue https://projects.theforeman.org/issues/28184 from this bug

Comment 8 Bryan Kearney 2020-02-03 17:05:50 UTC
Upstream bug assigned to kgaikwad

Comment 9 Bryan Kearney 2020-02-03 17:05:52 UTC
Upstream bug assigned to kgaikwad

Comment 10 Bryan Kearney 2020-02-12 17:07:50 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28184 has been resolved.

Comment 15 Kavita 2020-04-17 07:25:31 UTC
Hello Andreas, 

Updating package rubygem-foreman_maintain to 0.5.3 will resolve this.
As you mentioned, included in Satellite 6.7.

Moving this BZ to ON_QA for verification

Comment 16 Jameer Pathan 2020-06-10 07:31:56 UTC
Verified 

Verified with:
- Satellite 6.8.0 snap 3
- rubygem-foreman_maintain-0.6.4-1.el7sat.noarch

Test steps:
- Run foreman-maintain health check --label disk-performance
- ls -lh /var/lib/pulp/job1.0.0

Observation:
- While check is running it creates /var/lib/pulp/job1.0.0
- /var/lib/pulp/job1.0.0 is not present ones check finishes execution.

Note: disk-performance check won't run with other pre-upgrade checks.
Refer BZ#1827219 for more information.

Comment 19 errata-xmlrpc 2020-10-27 12:38:20 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 (Satellite 6.8 Satellite Maintenance Release), 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-2020:4365