Bug 1266755

Summary: [RFE] Provide a script testing integrity of records in DB
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: OtherAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WORKSFORME QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.1CC: bkearney, pmoravec
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-14 18:05:30 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 Pavel Moravec 2015-09-27 12:33:36 UTC
Description of problem:
There is often a case DB integrity is corrupted. Thats why repo-repair, clean_backend_objects rake scripts exist. There can be other ways how to get a corruption, see e.g. bz1263730.

It is requested to have an integrity check script, that can be run when there is a suspicion to an unknown DB data corruption. Such script *may* identify it, telling what relationship is missing or what orphaned record is missing.

An example:
- each Content View (published version?) must have its puppet class. This can be verified by a simple SELECT

The more such dependency-among-tables checks there will be, the better.

Such a script can help:
- GSS in identifying particular issues in postgres DB for a customer having a problem
- developers in checking if their fix or a new feature does not introduce a regression (during self-made testing/playing)
- QE in identifying regressions or incomplete fixes (when script is run as a sanity check after reproducer)


Version-Release number of selected component (if applicable):
foreman-1.7.2.34-1


How reproducible:
100%

Steps to Reproduce:
1. How to check data integrity in postgres DBs (mainly foreman one)?


Actual results:
No tool exists


Expected results:
A tool for data integrity to exist


Additional info:

Comment 2 Pavel Moravec 2015-10-01 08:04:30 UTC
An example integrity test:

- check that every katello repo has its pulp repo (and vice versa). This is something that repair_repos.rake script wont detect but happened in support case 01462756 (katello had composite content view with a repo with pulp_id missing in pulp).

Comment 3 Bryan Kearney 2016-07-08 20:36:46 UTC
Per 6.3 planning, moving out non acked bugs to the backlog