Bug 1405162

Summary: Do not index full rpm metadata if already present
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: RepositoriesAssignee: John Mitsch <jomitsch>
Status: CLOSED ERRATA QA Contact: Jonathon Turel <jturel>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.0CC: bbuckingham, jcallaha, jomitsch, jsherril, jturel
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:51:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Justin Sherrill 2016-12-15 18:12:16 UTC
Description of problem:

Currently during any repo sync, we:

1. check to see if there was any change (or mismatch of unit counts)
2. IF so we request all UUIDs of rpms in the repo
3. We then fetch all rpm units by their UUID

After chatting with mhrivnak, the unit metadata for an rpm should never change (for the fields we care about), so we could optimize this by getting the list of UUIDs and then only fetching (and updating) units that aren't in the repo.

This should speed up repo syncing quite a bit.

We may want to add a 'force' sync option to override this behavior as well.

Comment 4 John Mitsch 2017-02-23 21:09:31 UTC
Created redmine issue http://projects.theforeman.org/issues/18655 from this bug

Comment 5 Satellite Program 2017-03-13 20:16:48 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18655 has been resolved.

Comment 6 Jonathon Turel 2017-08-30 17:48:21 UTC
Verified in Sat 6.3 Snap 13 => satellite-6.3.0-16.0.beta.el7sat.noarch

I followed the steps in the PR: https://github.com/Katello/katello/pull/6634

=> Creating repo on filesystem with createrepo, adding a bunch of rpms, sync via HTTP, add more RPMs, sync & check output (A), sync again & check output (B)

Output A:

Started at: 2017-08-30 17:35:18 UTC
Ended at: 2017-08-30 17:35:22 UTC
Real time: 4.51s
Execution time (excluding suspended state): 4.51s
id: 5
contents_changed: true
full_index: false
current_user_id: 3

Note that full index was not run.

Output B:

id: 5
contents_changed: false
full_index: false
current_user_id: 3

post_sync_skipped: true

All output is exactly as described in the PR.

Comment 7 Satellite Program 2018-02-21 16:51:07 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, 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-2018:0336