[Yum-devel] [PATCH 2/2] Avoid creating countless transaction sets just to read packages
Panu Matilainen
pmatilai at laiskiainen.org
Fri Feb 11 15:10:50 UTC 2011
On 02/11/2011 04:22 PM, seth vidal wrote:
> On Fri, 2011-02-11 at 16:18 +0200, Panu Matilainen wrote:
>> Use the transaction handle we already have in populateTs() for fetching
>> headers from packages. Flipping bits for signature checking is
>> much cheaper and saner than instanciating and destroying entire
>> transaction sets once per every single package to be installed.
>>
>> Alternatively an optional ts argument could be added to
>> po.returnHeaderFromPackage() if that's preferred.
>
>
> I think it'd be nicer to do the latter here.
Okay, I'll change the patch to do that then.
> One of the biggest problems I've always had with the transaction set
> requirement for reading/accessing an individual rpm pkg is that it makes
> it impossible to separate out your objects entirely.
>
> Part of the reason for returnHeaderFromPackage() was to at least
> simulate that separation.
>
> Another idea - make rpm's interface not require the ts for everything.
Sure, but I'm trying to come up with something that's compatible with
what exists now, including RHEL 5.
The transaction set is indeed a rather, uh, amorphous entity. As it is,
it's best treated as a per-installroot singleton - so in practise a
global singleton. The returnHeaderFromPackage() case is not exactly
harmful, just wasteful, but having multiple transaction sets using the
same database (which I suspect can currently happen in yum) is pretty
much undefined behavior with unwanted side-effects, and future rpm
versions are likely to enforce a 1:1 relation.
- Panu -
More information about the Yum-devel
mailing list