Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-17494

"dnf history rollback <id>" operates as if it was a "undo" when <id> is not latest

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • rhel-9.5
    • rhel-8.9.0, rhel-9.3.0
    • libdnf
    • libdnf-0.69.0-10.el9
    • None
    • Moderate
    • rhel-sst-cs-software-management
    • ssg_core_services
    • 10
    • 12
    • 2
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Red Hat Enterprise Linux
    • None
    • Bug Fix
    • Hide
      .`dnf history rollback` now correctly executes during a repeated rollback of an RPM transaction that includes installation and upgrade of the same package

      Previously, when you performed a repeated rollback on an RPM transaction that included installation and upgrade of the same package, the `dnf history rollback` command attempted to perform a bogus transaction. This transaction failed instead of doing nothing because the rollback to the latest transaction had nothing to roll back.

      With this update, calculating a difference between the two same-version RPM transactions is now fixed in the `libdnf` library. As a result, `dnf history rollback` that points to the currently latest RPM transaction now correctly results in the `Nothing to do.` output.
      Show
      .`dnf history rollback` now correctly executes during a repeated rollback of an RPM transaction that includes installation and upgrade of the same package Previously, when you performed a repeated rollback on an RPM transaction that included installation and upgrade of the same package, the `dnf history rollback` command attempted to perform a bogus transaction. This transaction failed instead of doing nothing because the rollback to the latest transaction had nothing to roll back. With this update, calculating a difference between the two same-version RPM transactions is now fixed in the `libdnf` library. As a result, `dnf history rollback` that points to the currently latest RPM transaction now correctly results in the `Nothing to do.` output.
    • Done
    • None

      What were you trying to do that didn't work?

      dnf history rollback <id> is supposed to undo all transactions up to <id> but not <id> itself.
      It appears that rollbacking works as expected, but rollbacking to same id again tries to remove the transaction with that id, as shown in the example below:

      Initial state

       # dnf history
       ID     | Command line                                                    | Date and time    | Action(s)      | Altered
       ----------------------------------------------------------------------------------------------------------------------
           23 | install mc                                                      | 2023-11-28 11:47 | Install        |   42   
           22 | install telnet-0.17-76.el8                                      | 2023-11-28 11:47 | Upgrade        |    1   
           21 | install telnet-0.17-74.el8_3.1                                  | 2023-11-28 11:47 | Install        |    1   
       [...]
      

      Rollbacking once (PASS)

      
       # dnf history rollback 21
       [...]
       Removing:
        mc                             x86_64         1:4.8.19-9.el8                                   @app-os         6.8 M
       [...]
       Downgrading:
        telnet                         x86_64         1:0.17-74.el8_3.1                                app-os           72 k
       [...]
      

      Rollbacking twice (FAIL)

       # dnf history rollback 21
       [...]
       Removing:
        telnet                  x86_64                  1:0.17-74.el8_3.1                     @app-os                  119 k
       [...]
      

      Here above it now tries to remove the package, there is the bug.

      Please provide the package NVR for which bug is seen:

      How reproducible:

      Always, see above.

      Steps to reproduce:

      1. Install telnet-0.17-74.el8_3.1
      2. Install telnet-0.17-76.el8 (which ends up being an update)
      3. Install mc
      4. Rollback to telnet-0.17-76.el8 transaction
      5. Rollback again to telnet-0.17-76.el8 transaction

      Expected results

      2nd rollback does nothing or reinstalls the package as seen on RHEL7 (that latter behavior looks like a bug to me, but it's RHEL7, so ...).

      Actual results

      2nd rollback removes the package.

              rhn-support-ppisar Petr Pisar
              rhn-support-rmetrich Renaud Métrich
              packaging-team-maint packaging-team-maint
              Eva Mrakova Eva Mrakova
              Mariya Pershina Mariya Pershina
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: