Bug 2208535 - Prevent regenerating metadata for repositories that use complete mirroring
Summary: Prevent regenerating metadata for repositories that use complete mirroring
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.12.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.14.0
Assignee: Samir Jha
QA Contact: Partha Aji
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-19 12:56 UTC by Jeremy Lenz
Modified: 2023-07-07 21:52 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36453 0 Normal Ready For Testing Prevent regenerating metadata for repositories that use complete mirroring 2023-06-01 13:22:54 UTC
Red Hat Issue Tracker SAT-17848 0 None None None 2023-05-22 13:19:07 UTC

Description Jeremy Lenz 2023-05-19 12:56:55 UTC
Description of problem:

See discussion in https://bugzilla.redhat.com/show_bug.cgi?id=2184278

Regenerating repository metadata is dangerous for repositories that use the 'mirror_complete' mirroring policy because it will generate metadata locally, which means your repository is no longer completely mirrored.

The previous BZ addresses this in the web UI. However, you can still regenerate repository metadata for 'mirror_complete' repositories using the API or Hammer. We need to harden the backend code to

1. Refuse to do this for repositories that use complete mirroring
2. When regenerating metadata for CV version repositories, skip repos that use complete mirroring.

Comment 4 Samir Jha 2023-05-30 14:10:12 UTC
Created redmine issue https://projects.theforeman.org/issues/36453 from this bug

Comment 6 Bryan Kearney 2023-06-09 00:03:19 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36453 has been resolved.

Comment 7 Partha Aji 2023-07-03 20:27:19 UTC
Created and synced 2 repositories one with complete_mirror policy and the other with content_only policy
# hammer  repository republish --id=1 --force=1
Could not republish the repository.:
  Metadata republishing is not allowed on repositories with the 'Complete Mirroring' mirroring policy.

# hammer  repository republish --id=3 --force=1
[....................................................................................................................................................................] [100%]

Verified that the force parameter has been deprecated 
# hammer  repository republish --id=1 --help
Usage:
    hammer repository republish [OPTIONS]

Options:
....
 --force BOOLEAN                  Force metadata regeneration to proceed. (Deprecated)
 ....

Added both repositories to a content view and published. 
Followed that with
hammer  content-view version  republish --id=6
[....................................................................................................................................................................] [100%]

Noticed the content only repo's metadata got re-generated and the complete mirror one was ignored.


Note You need to log in before you can comment on or make changes to this bug.