Bug 665920

Summary: repodiff uses stale metadata cache in subsequent runs, if the repodata fails (it reverts)
Product: [Fedora] Fedora Reporter: Marcelo Moreira de Mello <mmello>
Component: yum-utilsAssignee: Seth Vidal <skvidal>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 14CC: james.antill, maxamillion, mmello, pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-16 16:52:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test connection on arguments passed
none
--nocache option none

Description Marcelo Moreira de Mello 2010-12-27 23:17:10 UTC
Description of problem:

When running two repodiff commands in succession, the second run will reuse cached data from the first. 
Version-Release number of selected component (if applicable):


How reproducible:
100%
Fedora 14

Steps to Reproduce:
1. repodiff -old=http://mirror.optus.net/fedora/linux/releases/13/Fedora/source/SRPMS/ --new=http://mirror.optus.net/fedora/linux/releases/13/Fedora/source/SRPMS/ --new=http://mirror.optus.net/fedora/linux/updates/13/SRPMS/ > /tmp/first.out

2. repodiff --old=http://doesnotexist.example.com/ --new=http://doesnotexist.example.com --new=http://reallydoesnotexist.example.com  > /tmp/noexist.out

3. diff /tmp/first.out /tmp/noexist.out

4. rm -rf /var/tmp/yum-*

5. repodiff --old=http://doesnotexist.example.com/ --new=http://doesnotexist.example.com --new=http://reallydoesnotexist.example.com  > /tmp/noexist.out
  
Actual results:

Even using a not valid host on the second run, repodiff reuse the cached data. 


Expected results:
repodiff validate when not connect or before reuse the cached data.

Comment 2 Marcelo Moreira de Mello 2010-12-27 23:20:02 UTC
Created attachment 470892 [details]
Test connection on arguments passed

Patch Proposed for connection test.

Comment 3 Marcelo Moreira de Mello 2010-12-28 18:27:52 UTC
Created attachment 470989 [details]
--nocache option

Hello, 

I wrote a small patch to refresh metadata cache. 

Patch Proposed: --nocache option to refresh metadata cache. 


$>git clone git://yum.baseurl.org/yum-utils.git
Cloning into yum-utils...
remote: Counting objects: 4847, done.
remote: Compressing objects: 100% (2857/2857), done.
remote: Total 4847 (delta 3177), reused 3003 (delta 1978)
Receiving objects: 100% (4847/4847), 787.44 KiB | 281 KiB/s, done.
Resolving deltas: 100% (3177/3177), done.
$> cd yum-utils/
$> patch -p0 < ../repodiff-upstream-connection-test.patch 
patching file repodiff.py
$> patch -p0 < ../repodiff-upstream-nocache-option.patch 
patching file repodiff.py
Hunk #2 succeeded at 38 (offset 2 lines).
Hunk #3 succeeded at 187 (offset 27 lines).
Hunk #4 succeeded at 217 (offset 27 lines).

$> ./repodiff.py --old=http://mirror.optus.net/fedora/linux/releases/13/Fedora/source/SRPMS/ --new=http://mirror.optus.net/fedora/linux/releases/13/Fedora/source/SRPMS/ --new=http://mirror.optus.net/fedora/linux/updates/13/SRPMS/ > /tmp/f13.diff
*Note* Red Hat Network repositories are not listed below. You must run this command as root to access RHN repositories.
$> ./repodiff.py --old=http://doesnotexist.example.com/ --new=http://doesnotexist.example.com --new=http://reallydoesnotexist.example.com 
Loaded plugins: fastestmirror, langpacks, presto, rhnplugin
Adding en_US to language list
*Note* Red Hat Network repositories are not listed below. You must run this command as root to access RHN repositories.
setting up repos
setting up old repo http://doesnotexist.example.com/
Connection Error: doesnotexist.example.com not reachable

$> ./repodiff.py --help
Usage: 
    repodiff: take 2 or more repositories and return a list of added, removed and changed
              packages.
              
    repodiff --old=old_repo_baseurl --new=new_repo_baseurl 

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -n NEW, --new=NEW     new baseurl[s] for repos
  -o OLD, --old=OLD     old baseurl[s] for repos
  -q, --quiet           
  -a ARCHLIST, --archlist=ARCHLIST
                        In addition to src.rpms, any arch you want to include
  -s, --size            Output size changes for any new->old packages
  --simple              output simple format
  --nocache             Remove metadata cache dir

Comment 4 Fedora End Of Life 2012-08-16 16:52:48 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping