Bug 246678

Summary: conduit.delPackage() extremely slow with newer yum
Product: [Fedora] Fedora Reporter: Stéphane Lesimple <speed47_redhat>
Component: yumAssignee: Jeremy Katz <katzj>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7CC: james.antill
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-03 20:39:20 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
Dirty and temporary workaround none

Description Stéphane Lesimple 2007-07-03 21:34:53 UTC
Description of problem:
The usage of the yum-priorities plugin (which extensively uses delPackage()) is
very difficult with the yum version bundled with Fedora 7. The issue doesn't
happen with the yum version included in Fedora Core 6.
I've added some python code in the plugin, to find that :
- Excluding ~3000 packages takes around 1 second with yum 3.0.6 (fc6)
- Excluding ~3000 packages takes more than 6 minutes with yum 3.2.0 (fc7). Same
issue with yum 3.2.1.

Version-Release number of selected component (if applicable):
yum-3.2.1-1.fc7

How reproducible:
Always

Steps to Reproduce:
1. Add a couple of repositories that have a lot of overlapping packages (i.e.
dries, rpmforge, rpmfarm, freshrpms)
2. Install the yum-priorities plugin
3. # time yum install NonExistentPackage
  
Actual results:
Takes long minutes

Expected results:
Should take a couple of seconds

Additional info:
The problem is due to the fact that YumSqlitePackageSack.delPackage() now sets
self.pkglist to None, forcing yum to rebuild the pkglist at _each_ call to
delPackage(). If you have 3000 packages to exclude, you rebuild the entire
pkglist 3000 times, even if you don't use it between the delPackage() calls.

External bug reference:
https://devel.linux.duke.edu/bugzilla/show_bug.cgi?id=756

About the attached patch:
This is not intended to be an out-of-the-box fix to the problem. Only a
workaround : it removes the offending line in delPackage() and delays the
pkglist rebuilding to right after the execution of the exclude_hook for the
plugins. The problem can probably be fixed in a more proper way.

Comment 1 Stéphane Lesimple 2007-07-03 21:34:53 UTC
Created attachment 158479 [details]
Dirty and temporary workaround

Comment 2 Seth Vidal 2007-08-03 20:39:20 UTC
This is fixed in upstream and will be in 3.2.3
thanks