-
Notifications
You must be signed in to change notification settings - Fork 58
fixes #18405 - modify upgrade to include rake tasks to fix mismatches #483
Conversation
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', |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!!
There was a problem hiding this 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
Code looks good, going to run a test with an internal db for timing sake |
There was a problem hiding this 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
LGTM too |
@stbenjam, @chris1984, @jlsherrill, Thanks guys! |
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.