Bug 1306304

Summary: [perf] cache installed set of packages in query (for updates)
Product: [Fedora] Fedora Reporter: 0xHM <mamoun.haris>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: jsilhan, mail, mamoun.haris, mluscon, packaging-team-maint, pnemade, vmukhame, zeljatux
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-1.1.7-2.fc23 dnf-1.1.7-2.fc24 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-26 17:58:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description 0xHM 2016-02-10 14:08:40 UTC
Description of problem:

DNF does not handle cli "repository-packages REPO upgrade" as it should.T
The problem is that current :

https://github.com/rpm-software-management/dnf/blob/master/dnf/base.py#L1559

    def upgrade_all(self, reponame=None):
        # :api
        if reponame is None:
            self._goal.upgrade_all()
        else:
            try:
                self.upgrade('*', reponame)
            except dnf.exceptions.MarkingError:
                pass

After getting to that point it will call upgrade function with packages "*".

After that it will filter all system packages, but why ?

        def is_installed_by_name(pkg_name):
            return first(self.sack.query().installed().filter(name=pkg_name))

Version-Release number of selected component (if applicable):

1.1.6
  Installed: dnf-0:1.1.6-2.fc23.noarch at 2016-02-05 12:07
  Built    : Fedora Project at 2016-02-03 12:23

  Installed: rpm-0:4.13.0-0.rc1.11.fc23.x86_64 at 2016-02-05 11:50
  Built    : Fedora Project at 2016-02-02 11:52


Steps to Reproduce:
1. add print before with https://github.com/rpm-software-management/dnf/blob/master/dnf/base.py#L1529  you can print the package name

 
2. dnf repository-packages REPONAME upgrade
3. wait

Actual results:
prints all packages installed
slowness


Expected results:
Can be done much faster and smarter.

Additional info:

Comment 1 Honza Silhan 2016-02-10 14:27:05 UTC
Thanks for the report.

Comment 2 Honza Silhan 2016-02-10 14:27:35 UTC
*** Bug 1254904 has been marked as a duplicate of this bug. ***

Comment 3 Fedora Update System 2016-02-25 13:53:09 UTC
dnf-plugins-core-0.1.17-1.fc23 dnf-1.1.7-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-0123ce82c1

Comment 4 Fedora Update System 2016-02-25 13:56:12 UTC
dnf-plugins-core-0.1.17-1.fc22 dnf-1.1.7-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f673381075

Comment 5 Fedora Update System 2016-03-09 17:19:36 UTC
dnf-1.1.7-2.fc23 dnf-plugins-core-0.1.17-1.fc23 libsolv-0.6.19-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-0123ce82c1

Comment 6 Fedora Update System 2016-03-09 17:21:24 UTC
dnf-1.1.7-2.fc22 dnf-plugins-core-0.1.17-1.fc22 libsolv-0.6.19-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f673381075

Comment 7 Fedora Update System 2016-03-10 16:52:50 UTC
dnf-1.1.7-2.fc22, dnf-plugins-core-0.1.17-1.fc22, libsolv-0.6.19-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-f673381075

Comment 8 Fedora Update System 2016-03-10 16:54:24 UTC
dnf-1.1.7-2.fc23, dnf-plugins-core-0.1.17-1.fc23, libsolv-0.6.19-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-0123ce82c1

Comment 9 Fedora Update System 2016-03-13 23:54:51 UTC
dnf-1.1.7-2.fc23, dnf-plugins-core-0.1.17-1.fc23, libsolv-0.6.19-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2016-03-19 12:15:53 UTC
dnf-1.1.7-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c030d24231

Comment 11 Fedora Update System 2016-03-20 03:57:45 UTC
dnf-1.1.7-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c030d24231

Comment 12 Fedora Update System 2016-03-26 17:57:37 UTC
dnf-1.1.7-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.