Bug 1194222 - [perf] dnf reinstall `rpm -qa` is slow
Summary: [perf] dnf reinstall `rpm -qa` is slow
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1234907 1236046 (view as bug list)
Depends On: 1167239
Blocks: 1156501
TreeView+ depends on / blocked
 
Reported: 2015-02-19 11:13 UTC by Daniel Mach
Modified: 2017-05-22 11:59 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-22 11:59:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 536818 0 low CLOSED Inefficient database disk reading 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1234907 0 unspecified CLOSED [perf] Slow dep solving with large set of packages 2021-02-22 00:41:40 UTC

Internal Links: 536818 1234907

Description Daniel Mach 2015-02-19 11:13:18 UTC
I was upgrading f21 to f22 and it crashed.
I ended up with quite inconsistent installed package set, which I had to fix manually. As part of that, I reinstalled all existing packages by running:
$ dnf reinstall `rpm -qa`

It takes a long time before depsolving starts.
I suppose lookups for individual packages are slow.
Is there a way how to speed it up?

This is a low priority fix, probably falling into nice-to-have category.

Comment 1 Honza Silhan 2015-04-16 15:53:27 UTC
Thanks for the report. The bottleneck could be in accessing yumdb (filesystem) for `from_repo` flag. This could be fixed by swdb arrival. Btw yum is a lot slower.

Comment 2 Daniel Mach 2015-04-17 08:31:59 UTC
Isn't yumdb loaded to memory when dnf/hawkey starts?

I think this is rather caused by retrieving 1 package at a time.
It would be nice if the query worked like this (I'm making this completely up):

input:
query([pattern1, pattern2, pattern3, ...])

output:
[
   [all pkgs matching pattern1],
   [], # <-- nothing matches pattern 2
   [all pkgs matching pattern3],
   ...
]

Comment 3 Zdenek Kabelac 2015-06-23 13:31:53 UTC
See my closed Bug 536818

From the POV of our 'rpm' developers problem is solved ;)

Comment 4 Zdenek Kabelac 2015-06-23 13:35:01 UTC
Comment 2 relates only for the timing  of  'rpm -qa' operation.

Comment 5 Honza Silhan 2015-07-29 11:37:58 UTC
*** Bug 1234907 has been marked as a duplicate of this bug. ***

Comment 6 Radek Holy 2015-07-29 12:02:25 UTC
*** Bug 1236046 has been marked as a duplicate of this bug. ***

Comment 7 Fedora Admin XMLRPC Client 2016-07-08 09:30:31 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 8 Fedora End Of Life 2016-07-19 20:52:41 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 9 Jaroslav Mracek 2017-03-27 15:40:08 UTC
Please can you try "sudo dnf reinstall '*' --assumeno" ?

It required only 2.2s and it has same functionality as reported syntax (but it do not report if package cannot be reinstalled). 

Syntax "sudo dnf reinstall `rpm -qa` --assumeno" required 36.3s what is not terrible I would say.

Syntax "sudo yum-deprecated reinstall `rpm -qa` --assumeno" required about 300s.

Tested on dnf-2.1.1_1-11g5af2514.fc25.noarch.

Are you satisfy with this result or 36s is too long?

Comment 10 Daniel Mach 2017-05-22 11:59:49 UTC
Reinstalling '*' works like a charm. It takes just couple seconds.

I used the
dnf reinstall `rpm -qa`
command as an example of poor query performance.
I think it works a bit faster.

As I'm part of the DNF team now, I'm closing the bug myself.


Note You need to log in before you can comment on or make changes to this bug.