Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected results in 'dnf history rollback' #2031

Closed
zhangrui182 opened this issue Dec 26, 2023 · 5 comments · Fixed by rpm-software-management/libdnf#1644
Closed

Unexpected results in 'dnf history rollback' #2031

zhangrui182 opened this issue Dec 26, 2023 · 5 comments · Fixed by rpm-software-management/libdnf#1644

Comments

@zhangrui182
Copy link
Contributor

zhangrui182 commented Dec 26, 2023

Version:
dnf-4.14.0-10
libdnf-0.69.0-2

here are the steps to reproduce the issue
1.dnf remove network-scripts
2.dnf install network-scripts
3.dnf history rollback 1

expected result:
reinstall network-scripts

actual results:
remove network-scripts

image
According to libdnf's processing logic for merge transaction, we should reinstall network-scripts,but dnf remove it.

@kontura kontura self-assigned this Jan 2, 2024
@kontura
Copy link
Contributor

kontura commented Jan 2, 2024

I believe there is no merge happening, the docs for rollback say:

Undo all transactions performed after the specified transaction. ...

Since you specified the remove network-scripts transaction dnf just undoes the install network-scripts transaction performed after -> so the expected result really is remove.

@zhangrui182
Copy link
Contributor Author

My description may be a bit ambiguous
here is my 'dnf history list'

[root@localhost ~]# dnf history list
ID     | Command line                                                                                               | Date and time    | Action(s)      | Altered
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
     3 | install network-scripts                                                                                    | 2024-01-12 14:24 | Install        |    3
     2 | remove network-scripts                                                                                     | 2024-01-12 14:24 | Removed        |    3
     1 |                                                                                                            | 2024-01-11 14:24 | Install        |  472 EE

In versions using dnf-4.2.23 and libdnf-0.48.0

[root@localhost ~]# dnf history rollback 1
Last metadata expiration check: 2:50:54 ago on Fri 12 Jan 2024 11:33:37 AM CST.
Rollback to transaction 1, from Thu 11 Jan 2024 02:24:30 PM CST
  Undoing the following transactions: 2, 3
    Reinstall network-scripts-teamd-1.30-1.x86_64 @upstream
    Reinstall network-scripts-10.04-1.h7.x86_64   @upstream
    Reinstall ppp-2.4.8-1.h4.x86_64               @upstream
Dependencies resolved.
Nothing to do.
Complete!

But in versions using dnf-4.14.0-10 and libdnf-0.69.0-2,‘dnf rollback 1’ will remove network-scripts

@kontura
Copy link
Contributor

kontura commented Jan 15, 2024

I see, you are correct.
It is indeed not working correctly.

Thank you for the reproducer.

@chenhaixing123
Copy link
Contributor

chenhaixing123 commented Jan 30, 2024

First problem version:dnf-4.6.0
related: #1689
I tried to give the code to solve the problem, but I'm not sure if it's correct.
PR:#2042
Please help me review it together. @kontura @zhangrui182 @jan-kolarik

@jan-kolarik
Copy link
Member

First problem version:dnf-4.6.0 related: #1689 I tried to give the code to solve the problem, but I'm not sure if it's correct. PR:#2042 Please help me review it together. @kontura @zhangrui182 @jan-kolarik

@chenhaixing123 Thanks for looking into that! I will try to review the PR during the next week.

@jan-kolarik jan-kolarik assigned jan-kolarik and unassigned kontura Feb 26, 2024
jan-kolarik added a commit to rpm-software-management/ci-dnf-stack that referenced this issue Feb 27, 2024
Based on the changes of transaction merging behavior for packages with the same version, as introduced in: rpm-software-management/dnf#2031.
j-mracek pushed a commit to rpm-software-management/ci-dnf-stack that referenced this issue Mar 12, 2024
Based on the changes of transaction merging behavior for packages with the same version, as introduced in: rpm-software-management/dnf#2031.
ppisar pushed a commit to ppisar/ci-dnf-stack that referenced this issue Apr 23, 2024
Upstream commit: 8234f42

Based on the changes of transaction merging behavior for packages with the same version, as introduced in: rpm-software-management/dnf#2031.

For: https://issues.redhat.com/browse/RHEL-17494
ppisar pushed a commit to rpm-software-management/ci-dnf-stack that referenced this issue May 2, 2024
Upstream commit: 8234f42

Based on the changes of transaction merging behavior for packages with the same version, as introduced in: rpm-software-management/dnf#2031.

For: https://issues.redhat.com/browse/RHEL-17494
glum23 pushed a commit to rpm-software-management/ci-dnf-stack that referenced this issue Aug 15, 2024
Upstream commit: 8234f42

Based on the changes of transaction merging behavior for packages with the same version, as introduced in: rpm-software-management/dnf#2031.

For: https://issues.redhat.com/browse/RHEL-17494
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment