Bug 1402798

Summary: looks like `cdn-sync --no-rpms` downloads headers of RPMs even if they are already in the database
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: Satellite SynchronizationAssignee: Gennadii Altukhov <galtukho>
Status: CLOSED NOTABUG QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 580CC: dyordano, galtukho, tlestach
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-19 10:24:47 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:
Bug Depends On:    
Bug Blocks: 1340444    

Description Jan Hutař 2016-12-08 11:25:17 UTC
Description of problem:
Looks like `cdn-sync --no-rpms` downloads headers of RPMs even if they are already in the database.


Version-Release number of selected component (if applicable):
spacewalk-backend-cdn-2.5.3-32.el6sat.noarch


How reproducible:
always


Steps to Reproduce:
1. cdn-sync --no-rpms --no-kickstarts -c rhel-x86_64-server-6
2. rm -rf /var/cache/rhn/reposync/*
3. cdn-sync --no-rpms --no-kickstarts -c rhel-x86_64-hpc-node-6


Actual results:
Looks like second sync still downloads headers (?) of the rpms although these we already downloaded and imported


Expected results:
If package is in DB, it should not be downloaded again

Comment 2 Gennadii Altukhov 2016-12-15 13:38:51 UTC
I investigated this issue. I don't see a bug.
This is how it works now:
1) It asks yum plugin for a list of packages.
2) for every package trying to find a package in DB with the same NVREA. 
3) If a package exists in DB we download it *ONLY* in case if a checksum is different.

Comment 3 Jan Hutař 2016-12-18 21:08:28 UTC
Hmm, seems you are right. Would it be possible to hide this:

[...]
16:05:12 454/471 : spacewalk-remote-utils-1.7.1-7.el5sat.noarch
[...]

for packages we are not downloading? If not, I'm OK with that and please feel free re-close.