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 #33518 - do not regenerate metadata on force sync #9661

Merged
merged 1 commit into from Sep 29, 2021

Conversation

jlsherrill
Copy link
Member

for mirrored repos

  • Updates capsule syncing to never regenerate metadata for yum repos
    • Also cleans and simplifies the code by using a lookup to find the
      publication href, instead of passing it around
  • Updates repo sync to never regenerate metadata on a force sync

@theforeman-bot
Copy link

Issues: #33518

@jlsherrill
Copy link
Member Author

Some things i tested:

  • Sync a library yum repo with mirror on sync turned on via normal sync and force sync, notice the timestamp in the repomd.xml file in the repo does not change
  • Sync a library yum repo with mirror on sync turned off via normal sync and force sync, the timestamp should change on every force sync, but not a normal sync
  • sync file/docker/yum repos to a capsule, notice that no matter how many syncs or force syncs you do, the timestamp in the repomd.xml file does not change on the capsule yum repo and matches the satellite's repomd.xml file's timestamp

When i say timestamp above, i'm referring to the '1632317374' field in the ./repodata/repomd.xml file

@ianballou
Copy link
Member

[test katello]

@ianballou
Copy link
Member

I found an issue with a missing publication:

  1. After creating a repo and syncing it both with mirror on and off, I added it to a content view with some filters
  2. I published, promoted, and synced the environment to a smart proxy
  3. Next, I set the repository to use mirroring again
  4. After changing up the filters and republishing + promoting, I noticed that the proxy was now getting 404s on syncing and the distribution was missing a publication.
  5. The distribution + publication for the Library repo is fine, but not the content view repos

@jlsherrill
Copy link
Member Author

A couple of notes on the latest updates:

  1. some actions like uploading content or removing content must force a metadata generation, thus i added a :force_publication option to be passed in. In the future we should forbid uploading/removing content for 'mirrored' repositories. Then this would not be needed
  2. I changed the check about whether to create a publication to check if force_publication is passed or the current publication_href is nil. this was metadata generates after repo creation will get executed across the app and tests

@jlsherrill
Copy link
Member Author

and this is ready for testing again :)

for mirrored repos

* Updates capsule syncing to never regenerate metadata for yum repos
  * Also cleans and simplifies the code by using a lookup to find the
    publication href, instead of passing it around
* Updates repo sync to never regenerate metadata on a force sync
Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

This is working fine for me!

@jlsherrill jlsherrill merged commit a6512bd into Katello:master Sep 29, 2021
@jlsherrill jlsherrill deleted the 33518 branch September 29, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants