Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

fixes #18405 - modify upgrade to include rake tasks to fix mismatches #483

Merged
merged 1 commit into from
Mar 6, 2017

Conversation

bbuckingham
Copy link
Member

There exist several rake tasks in katello to resolve data integrity
issues (or mismatches) between it and the backend services
(pulp and candlepin). This commit adds those steps to the installer
upgrade process so that the issues can be addressed automatically
versus the current behavior which may result in a failed upgrade
and then a need to run them manually.

Note: this is primarily for differences related to repository
and consumer resources.

The commit also includes an option (--disable-resolve-mismatches)
to run the upgrade without making any changes. It will still
run the tasks and report the changes that it would have made.

There exist several rake tasks in katello to resolve data integrity
issues (or mismatches) between it and the backend services
(pulp and candlepin).  This commit adds those steps to the installer
upgrade process so that the issues can be addressed automatically
versus the current behavior which may result in a failed upgrade
and then a need to run them manually.

Note: this is primarily for differences related to repository
and consumer resources.

The commit also includes an option (--disable-resolve-mismatches)
to run the upgrade without making any changes.  It will still
run the tasks and report the changes that it would have made.
@@ -4,3 +4,9 @@
"Run the steps necessary for an upgrade such as migrations, rake tasks, etc.",
:default => false
)
app_option(
'--disable-resolve-mismatches',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick but for consistency sake, the Kafo convention for negative options would be --no-resolve-mismatches

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I guess we break the convention already with --disable-system-checks, doesn't really matter to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stbenjam, yeah, i based it off of the disable-system-checks, but am totally open to opinions for consistency and clarity. :)

Thanks for reviewing!!

Copy link
Contributor

@stbenjam stbenjam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test it but the code looks good

@chris1984
Copy link
Member

Code looks good, going to run a test with an internal db for timing sake

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Results of my test:

Stock upgrade:
real 11m14.959s
user 2m14.084s
sys 0m13.208s

Upgrade with PR:
real 13m3.179s
user 2m27.789s
sys 0m13.600s

Proof it works:

Upgrade Step: correct_repositories (this may take a while) ...
[ INFO 2017-03-01 00:41:36 verbose] Upgrade Step: correct_repositories (this may take a while) ...
Successfully encrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully encrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Processing Repository 1/6: Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server (1)
Repository 1 Missing
Recreating 1

Upgrade Step: clean_backend_objects (this may take a while) ...
[ INFO 2017-03-01 00:41:59 verbose] Upgrade Step: clean_backend_objects (this may take a while) ...
Successfully encrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully encrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Host 3 rhel7.example.com 421fae67-5c53-4384-80fc-7beec1cafa36 is partially missing. Un-registering

Approving this PR

@jlsherrill
Copy link
Member

LGTM too

@bbuckingham
Copy link
Member Author

@stbenjam, @chris1984, @jlsherrill, Thanks guys!

@bbuckingham bbuckingham merged commit d925533 into Katello:master Mar 6, 2017
@bbuckingham bbuckingham deleted the 18405 branch March 6, 2017 18:28
zjhuntin pushed a commit to zjhuntin/katello-installer that referenced this pull request Oct 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants