[Yum-devel] Yum Locking

James Antill james at fedoraproject.org
Tue Jul 20 18:30:38 UTC 2010


On Tue, 2010-07-20 at 14:01 -0400, JohnS wrote:
> The exact problem is yum can't get a lock on the meta data db in an nfs
> root.  I have browsed the yum list and seen the same problems and no fix
> for it yet or really mention of even if it could be fixed.

 Define "locking".

 Atm. yum does:

1. When generating the repodata sqlite DBs sqlite will automatically
lock those. This is _per_ DB though, so does not really do anything
useful for yum. This also requires the repodata only ships .xml data,
which isn't best practice.

2. When reading the repodata sqlite DBs I _think_ sqlite takes read-only
locks on the DB ... against this doesn't really help us, and if we
haven't turned it off already it's very plausible that we will.

3. When reading/writing the history DB we have sqlite locking there.
This should protect the sqlite DB, but doesn't do much for yum itself
(esp. downloading/updating repodata and packages).

4. When we are running _as root_, we create /var/run/yum.pid as a "lock
file". This is an old style "dot locking" mechanism though (but using
the actual filename). This serializes all root yum instances on a single
machine.

...we have plans to change #4 so that it'll work with normal users as
well as root (ie. use a file based on cachedir).
 This will _help_ your situation of running as root from multiple
machines, assuming we move the lock file for root too, as each machine
will be able to see the lock file if you just share /var/cache/yum. I
doubt we'll be guaranteeing it works though, just as we don't now (lots
of work from other people may persuade us :).

 In general for people who want this, I always recommend you read:

http://yum.baseurl.org/wiki/YumMultipleMachineCaching

-- 
James Antill - james at fedoraproject.org
http://yum.baseurl.org/wiki/whatsnew/3.2.28
http://yum.baseurl.org/wiki/YumBenchmarks
http://yum.baseurl.org/wiki/YumHistory


More information about the Yum-devel mailing list