Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1512082 - Check candlepin database validity as part of pre-upgrade steps
Summary: Check candlepin database validity as part of pre-upgrade steps
Keywords:
Status: CLOSED DUPLICATE of bug 1520326
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Foreman Maintain
Version: 6.2.12
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: Unspecified
Assignee: Kavita
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: 1496794
TreeView+ depends on / blocked
 
Reported: 2017-11-10 19:36 UTC by Justin Sherrill
Modified: 2019-04-12 15:04 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-11 14:19:45 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 21927 None None None 2018-01-10 12:46:05 UTC

Description Justin Sherrill 2017-11-10 19:36:04 UTC
Description of problem:

A command is being added to Satellite 6.3 (candlepin 2) to check the database prior to the cp database migration for any database validity problems that could cause the upgrade to fail. 

This needs to be added somehow to a 6.2.z/foreman-maintain release so that users can run this prior to the upgrade to 6.3.


Version-Release number of selected component (if applicable):
6.2.z


The idea being that the user would run 'foreman-maintain upgrade check' and some queries would be run to determine the health of the candlepin database prior to starting the 6.3 upgrade.

Comment 2 Brad Buckingham 2017-11-14 18:32:13 UTC
Ivan, Anurag,

Should this go in to foreman-maintain 0.5 or 1.0 instead of Satellite 6.2.z?

Comment 3 Ivan Necas 2017-11-14 19:22:09 UTC
F-m 1.0

Comment 4 Brad Buckingham 2017-11-14 19:29:01 UTC
Aligning to foreman-maintain 1.0 based upon comment 3.  Please reach out to bcourt or jsherrill on any questions to ensure this is captured and available in time for maintenance-1.0.

Comment 5 Justin Sherrill 2017-11-14 20:47:45 UTC
Crog suggested we use https://github.com/candlepin/candlepinproject.org/blob/master/binaries/cpvalidation.zip and run liquibase pointing at that.  Chris Rog should have more details on how to do that.

Comment 6 Justin Sherrill 2017-11-17 21:33:13 UTC
Information on how to run those validation steps:  https://github.com/candlepin/candlepinproject.org/blob/master/docs/candlepin/database_validation.md

Comment 7 Kavita 2017-12-12 13:42:07 UTC
Found similar BZ created by Lukas - https://bugzilla.redhat.com/show_bug.cgi?id=1520326 
where he mentioned below command to check candlepin validation 

# /usr/share/candlepin/cpdb --validate --verbose

I would like to confirm whether above command serves the purpose of this BZ or not as version value specified for both BZs are different.

Comment 8 Justin Sherrill 2017-12-13 02:16:10 UTC
Reading the instructions:

https://github.com/candlepin/candlepinproject.org/blob/master/docs/candlepin/database_validation.md

it appears these are the same operation.  Lzap says:

WARNING: On installations pre 6.2.14 the cpdb utility will fail as the command line option will not be present

I'm not sure what is actually causing this to be brought into 6.2.14 (as my discussion with the candlepin team did not reveal this).

Lzap, can you shed some light?  thanks!

Comment 9 Lukas Zapletal 2017-12-13 08:05:20 UTC
Not sure what you are asking for, Justin. Let me try.

In Sat 6.2 we do have "cpdp" but currently it don't understand --validate option, so it fails out with "Command line option not found" or similar.

As part of the workaround for the issue we had during beta testing, CP guys backported the "--validate" option into 6.2 series, now it should be present. Providing this option will perform only validation of the database, not migration.

The goal of formean-maintain is then calling this prior upgrading. An extra action might need to be taken if error is found (e.g. delete orhpaned records or similar).

Comment 10 Justin Sherrill 2017-12-13 14:45:10 UTC
bcourt, can you clarify if what is being backported to 6.2.14 matches this: https://github.com/candlepin/candlepinproject.org/blob/master/docs/candlepin/database_validation.md  ?

Comment 13 pm-sat@redhat.com 2018-01-10 13:23:11 UTC
Upstream bug assigned to kgaikwad@redhat.com

Comment 15 Justin Sherrill 2018-01-11 14:19:45 UTC
Then yes, this seems to be a duplicate.

*** This bug has been marked as a duplicate of bug 1520326 ***


Note You need to log in before you can comment on or make changes to this bug.