Sugg: Improve for mock (caching)

Ralf Corsepius rc040203 at freenet.de
Fri Nov 4 04:18:18 UTC 2005


On Thu, 2005-11-03 at 16:22 -0500, seth vidal wrote:
> On Thu, 2005-11-03 at 22:14 +0100, Jochen Schmitt wrote:

> > After the you could call apt to install a package and as far as I
> > remember the overhead was small i opposite of yum.
> 
> On any given consecutive run of yum the overhead should be:
> 1. contact hosts and retrieve repomd.xml
> 2. if the repomd.xml is unchanged, open the sqlite files
> 3. if the repomd.xml is updated, then update the metadata.
> but that's it. In most of the cases it should just go directly to the
> sqlite files.
> 
> Are you seeing a problem with gathering the repomd.xml files?

Yes. Just try it yourself and you'll probably see.

Real world example as of a couple of minutes ago:

# yum  update
Setting up Update Process
Setting up repositories
extras                    100% |=========================| 1.1 kB
00:00
updates-released          100% |=========================|  951 B
00:00
base                      100% |=========================| 1.1 kB
00:00
Reading repository metadata in from local files
No Packages marked for Update/Obsoletion

# yum  update
Setting up Update Process
Setting up repositories
extras                    100% |=========================| 1.1 kB
00:00
updates-released          100% |=========================|  951 B
00:00
http://ftp.chg.ru/pub/Linux/fedora/core/4/i386/os/repodata/repomd.xml:
[Errno 4] IOError: HTTP Error 404: D ate: Fri, 04 Nov 2005 03:56:31 GMT
Server: Apache/1.3.33 (Unix)
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
Trying other mirror.
base                      100% |=========================| 1.1 kB
00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 331 kB
00:08
updates-re: ################################################## 954/954
Added 3 new packages, deleted 32 old in 3.68 seconds
No Packages marked for Update/Obsoletion

# yum  update
Setting up Update Process
Setting up repositories
extras                    100% |=========================| 1.1 kB
00:00
updates-released          100% |=========================|  951 B
00:00
base                      100% |=========================| 1.1 kB
00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 877 kB
00:19
extras    : ################################################## 2440/2440
Added 521 new packages, deleted 347 old in 14.36 seconds
primary.xml.gz            100% |=========================| 334 kB
00:07
updates-re: ################################################## 981/981
Added 28 new packages, deleted 1 old in 4.57 seconds
No Packages marked for Update/Obsoletion

# yum  update
Setting up Update Process
Setting up repositories
extras                    100% |=========================| 1.1 kB
00:00
updates-released          100% |=========================|  951 B
00:00
base                      100% |=========================| 1.1 kB
00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 806 kB
00:17
extras    : ################################################## 2266/2266
Added 347 new packages, deleted 521 old in 11.57 seconds
No Packages marked for Update/Obsoletion

As you can see, inaccessible mirrors and mirrors being out of sync cause
yum to iterate between different repomd.xml's and trigger repeated and
unnecessary downloads of further primary.xml.gz files.

Depending on which yum call actually having been issued and on the
mirrors' states, I've seen this triggering series of filelists.xml.gz
and other.xml.gz downloads.

IMO, yum should have an "apt-get update" counterpart, which should
download repomd.xml once and then would continue using the mirror this
particular repomd.xml had been downloaded from, only, until yum
discovers this cached repomd.xml is out-of-date.

Ralf






More information about the fedora-extras-list mailing list