Bug 1713194

Summary: [RFE] New check - warning when there are many fact names
Product: Red Hat Satellite Reporter: Lukas Zapletal <lzap>
Component: Satellite MaintainAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: high Docs Contact:
Priority: high    
Version: 6.6.0CC: apatel, bkearney, egolov, inecas, kgaikwad, mbacovsk, pmoravec, sthirugn, vijsingh
Target Milestone: 6.8.0Keywords: FutureFeature, PrioBumpField, PrioBumpPM, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-0.6.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 Lukas Zapletal 2019-05-23 06:26:53 UTC
Customers often suffer from many fact names which can slower performance of whole instance. Please add new check:

hosts_count = select count(*) from host;
facts_count = select count(*) from fact_name;

if facts_count > 10_000 + hosts_count * 2

  print warning "There are more fact names than estimated #{facts_count}, consider adding fact exclude filter."

end

This should give a reasonable warning threshold:

1k hosts = 12k fact names
10k hosts = 30k fact names
50k hosts = 110k fact names

Comment 6 Lukas Zapletal 2019-06-18 11:40:29 UTC
I want to deliver a foreman-maintain check and a blog article about this. Give me more time.

Comment 8 Lukas Zapletal 2019-06-18 14:46:36 UTC
I am implementing more straightforward way of checking for hosts with many fact names.

Comment 9 Bryan Kearney 2019-06-18 16:04:33 UTC
Upstream bug assigned to lzap

Comment 10 Bryan Kearney 2019-06-18 16:04:34 UTC
Upstream bug assigned to lzap

Comment 11 Bryan Kearney 2019-11-21 17:05:55 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27075 has been resolved.

Comment 12 Jameer Pathan 2020-07-01 08:38:51 UTC
Verified

Verified with:
- Satellite 6.8.0 snap 6
- rubygem-foreman_maintain-0.6.5-1.el7sat.noarch

Test steps:
- Run "foreman-maintain health check --label foreman-fact-names"
- Modified max fact value for testing purpose.
- Run "foreman-maintain health check --label foreman-fact-names"

Observation:
- Check detects whether hosts has fact values more than a certain number.(Currently 10000)
- It gives link to KCS article https://access.redhat.com/solutions/4163891

# foreman-maintain health check --label foreman-fact-names
Running ForemanMaintain::Scenario::FilteredScenario
================================================================================
Check number of fact names in database:                               [OK]
--------------------------------------------------------------------------------

# foreman-maintain health check --label foreman-fact-names
Running ForemanMaintain::Scenario::FilteredScenario
================================================================================
Check number of fact names in database:                               [WARNING]
Host (ID 1) has 405 fact values which is more than 100.
This can cause slow fact processing.
--------------------------------------------------------------------------------
Continue with step [Show knowledge base article for troubleshooting]?, [y(yes), n(no), q(quit)] y
Show knowledge base article for troubleshooting:                                
Go to https://access.redhat.com/solutions/4163891
please follow steps from above article to resolve this issue
press ENTER once done.

                                                                      [OK]
--------------------------------------------------------------------------------
Rerunning the check after fix procedure
Check number of fact names in database:                               [WARNING]
Host (ID 1) has 405 fact values which is more than 100.
This can cause slow fact processing.
--------------------------------------------------------------------------------
Continue with step [Show knowledge base article for troubleshooting]?, [y(yes), n(no), q(quit)] n
Scenario [ForemanMaintain::Scenario::FilteredScenario] failed.                  

The following steps ended up in warning state:

  [foreman-fact-names]

The steps in warning state itself might not mean there is an error,
but it should be reviewed to ensure the behavior is expected

Comment 15 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