Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1890683 - [RFE] smartly sync capsules with history tracking
Summary: [RFE] smartly sync capsules with history tracking
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Capsule - Content
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.9.0
Assignee: Samir Jha
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-22 17:40 UTC by Brad Buckingham
Modified: 2024-12-20 19:19 UTC (History)
11 users (show)

Fixed In Version: tfm-rubygem-katello-3.18.1-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: sat-smartsync (view as bug list)
Environment:
Last Closed: 2021-04-21 13:18:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30824 0 Normal Closed smartly sync capsules with history tracking 2021-02-15 15:52:13 UTC
Foreman Issue Tracker 31469 0 Normal Closed smart proxy sync fails with puppet content, leading to paused tasks. 2021-02-15 15:52:14 UTC
Red Hat Product Errata RHSA-2021:1313 0 None None None 2021-04-21 13:18:40 UTC

Description Brad Buckingham 2020-10-22 17:40:06 UTC
Solution is such that:

We can store some data: 
smart_proxy_id 
repository_id
started
finished

*As part of any capsule sync for a given repo*: SYNC_HISTORY At the start of the sync for a given repo and smart proxy, any entry in the data would be deleted A new entry would be created with the current start time At the end of the sync, the finished time would be filled in, if the data still exists (hasn't been deleted by another task) This functions as a 'two-stage' ACK of having synced successfully

*As part of CV promotion* if changes are detected for a given repo during CV promotion, delete any entries for those repos in the SYNC_HISTORY table

*as part of repository update* if a repository is updated, unprotected changed or download_policy changed (for inherited proxies), delete all history items for any instance of that repository

*as part of content upload into a repo*, any history events for that repo are deleted.

*if upstream_name for docker repos is changed*, delete all history items for that particular repostiory

*at repo sync time in Library* if there are changes (or package upload/remove), we need to delete all hsitory items for that particular repository

*At capsule sync time*, if a history event exists in the table for a given repo and smart proxy that 'finished', do not schedule the sync.
*
A full capsule sync* will delete all history events for that capsule

Comment 1 Brad Buckingham 2020-10-22 17:40:10 UTC
Created from redmine issue https://projects.theforeman.org/issues/30824

Comment 2 Brad Buckingham 2020-10-22 17:40:11 UTC
Upstream bug assigned to None

Comment 3 Bryan Kearney 2020-11-06 20:02:12 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30824 has been resolved.

Comment 5 Tasos Papaioannou 2021-01-15 21:09:42 UTC
Verified on 6.9.0 snap 9.0.

1.) Add a Capsule to a lifecycle environment.
2.) Sync a new repo and add it to a content view.
3.) Publish and promote the content view to the lifecycle environment.
4.) Sync the Capsule.
5.) Check that a history record exists on the Satellite:

# foreman-rake console
irb(main):001:0> ::Katello::SmartProxySyncHistory.count 
=> 1

irb(main):003:0> ::Katello::SmartProxySyncHistory.all
=> #<ActiveRecord::Relation [#<Katello::SmartProxySyncHistory id: 3, smart_proxy_id: 2, repository_id: 7, started_at: "2021-01-15 18:57:35", finished_at: "2021-01-15 18:58:23">]>

6.) Sync the Capsule again, with the 'Optimized Sync' option.
7.) Verify that the history is the same:

irb(main):004:0> ::Katello::SmartProxySyncHistory.all
=> #<ActiveRecord::Relation [#<Katello::SmartProxySyncHistory id: 3, smart_proxy_id: 2, repository_id: 7, started_at: "2021-01-15 18:57:35", finished_at: "2021-01-15 18:58:23">]>

8.) Sync the Capsule again, with the 'Complete Sync' option.
9.) Verify that a new history record is now present for the repo and capsule:

irb(main):009:0> ::Katello::SmartProxySyncHistory.all
=> #<ActiveRecord::Relation [#<Katello::SmartProxySyncHistory id: 4, smart_proxy_id: 2, repository_id: 7, started_at: "2021-01-15 19:45:38", finished_at: "2021-01-15 19:48:03">]>

Comment 8 errata-xmlrpc 2021-04-21 13:18:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.9 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1313


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