Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36562 - Clear RootRepo checksum if on_demand repo #10635

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

sayan3296
Copy link
Contributor

@sayan3296 sayan3296 commented Jun 30, 2023

What are the changes introduced in this pull request?

Upgrade migration to clear checksum_type from RootRepositories for repos with on_demand download policy, before saving the repos.

Considerations taken when implementing this change?

In certain cases where users are upgrading their instance from a very old version of katello (at some point they either have done validate content sync or due to some other really weird reason), They may have a few on_demand repos left with some checksum_type set. But as this combination should not exist and can fail the RemoveDrpmFromIgnorableContent migration, we want to unset the checksum_type for such repos before executing root.save!

What are the testing steps for this pull request?

  • Install Katello 4.4
  • Enable a few repos ( having on_demand download policy )
  • Use a DB query like this to set a specific checksum_type for them i.e.
echo "update katello_root_repositories set checksum_type = 'sha256' where content_type='yum' ;" | su - postgres -c "psql foreman"
  • Upgrade to 4.5 and observe the failure during db:migrate
  • Apply the changes from this PR
  • Re-run db:migrate and it should be successful
  • Re-run the upgrade and that should be completed successfully as well.

@theforeman-bot
Copy link

Issues: #36562

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.

ACK works, installer upgraded fine with patch

Upgrade Step 2/2: katello:clean_backend_objects. This may take a long while.
0 orphaned consumer id(s) found in candlepin.
Candlepin orphaned consumers: []
  Success!
  * Foreman is running at https://centos8-stream-katello-4-4.area52.example.com
  * To install an additional Foreman proxy on separate machine continue by running:

      foreman-proxy-certs-generate --foreman-proxy-fqdn "$FOREMAN_PROXY" --certs-tar "/root/$FOREMAN_PROXY-certs.tar"
  * Foreman Proxy is running at https://centos8-stream-katello-4-4.area52.example.com:9090

@chris1984 chris1984 merged commit f0ab69d into Katello:master Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants