dnf icon indicating copy to clipboard operation
dnf copied to clipboard

Add all candidates for reinstall to solver

Open j-mracek opened this issue 1 year ago • 6 comments

Resolves: https://issues.redhat.com/browse/RHEL-25005

j-mracek avatar Feb 15 '24 11:02 j-mracek

The patch looks good. But the original bugreport reported the issue with install command (which works correctly according to my attempts to reproduce it). This patch fixes incorrect reinstall behavior.

m-blaha avatar Feb 15 '24 16:02 m-blaha

The patch looks good. But the original bugreport reported the issue with install command (which works correctly according to my attempts to reproduce it). This patch fixes incorrect reinstall behavior.

Reporter incorrectly reported issue for install command, but https://issues.redhat.com/browse/RHEL-25005?focusedId=24167516&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-24167516 corrected the reproducer. The issue is not related to install command and even not to cost option. Setting cost option only shoved strange behavior but in background DNF send to libsolv available RPM with higher ID.

j-mracek avatar Feb 16 '24 11:02 j-mracek

@j-mracek I see. We're good to go then.

m-blaha avatar Feb 16 '24 11:02 m-blaha

Shouldn't we provide a test case for this?

m-blaha avatar Feb 16 '24 11:02 m-blaha

I can but I cannot ensure that the test will always fail without the patch, because the behavior without patch is not deterministic enough. Without patch the load of repository is driven by sorter in iterator.

    def items(self):
        """return repos sorted by priority"""
        return (item for item in sorted(super(RepoDict, self).items(),
                                        key=lambda x: (x[1].priority, x[1].cost)))

j-mracek avatar Feb 16 '24 12:02 j-mracek

I created a test - https://github.com/rpm-software-management/ci-dnf-stack/pull/1451

j-mracek avatar Feb 16 '24 13:02 j-mracek