Bug 1861868

Summary: [RFE] Allow for idempotent database migrations
Product: Red Hat Satellite Reporter: Eric Helms <ehelms>
Component: CandlepinAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Vladimír Sedmík <vsedmik>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8.0CC: redakkan
Target Milestone: UnspecifiedKeywords: FutureFeature, PrioBumpQA, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1867977 (view as bug list) Environment:
Last Closed: 2022-10-28 18:00:09 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: 1867977    

Description Eric Helms 2020-07-29 18:46:46 UTC
I would like to be able to detect if there are pending Candlepin database migrations to allow only running the migration task if there are. This helps the Satellite installer be idempotent.

[root@pipeline-upgrade-luna-nightly-centos7 candlepin]# ./cpdb --status --user=candlepin --password W7EkKTcVvT6W654kexPLFCQRNhDeoMxt
Configuring PostgreSQL with JDBC URL: jdbc:postgresql:candlepin
--driver=org.postgresql.Driver --classpath=/var/lib/tomcat/webapps/candlepin/WEB-INF/lib/postgresql-42.2.2.jar:/var/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --url=jdbc:postgresql:candlepin --username=$DBUSERNAME --changeLogFile=db/changelog/changelog-update.xml --password=$DBPASSWORD --logLevel=severe
4 change sets have not been applied to candlepin@jdbc:postgresql:candlepin
     db/changelog/20140408160212-add-pool-source-sub-table.xml::20140408160212-4::ckozak
     db/changelog/20140408160212-add-pool-source-sub-table.xml::20140408160212-5::ckozak
     db/changelog/20150401140006-add-pool-type-to-db.xml::20150401140006-3::crog
     db/changelog/20170718095058-purge-orphaned-pools.xml::20170718095058-0::crog
Liquibase 'status' Successful

This would imply there are 4 changesets that need migrated and applied. If I then run 'migrate' I see it try to apply these changesets, mention "skip on failure" in the logs. This implies that this check will never return 0 as there are changsets that attempt to get applied, are skipped and the migration is OK with that.

Comment 1 Brad Buckingham 2022-09-02 20:25:18 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 2 Brad Buckingham 2022-09-05 22:56:27 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 4 Brad Buckingham 2022-10-28 18:00:09 UTC
Thank you for your interest in Red Hat Satellite. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this feel free to contact your Red Hat Account Team. Thank you.