Bug 1807446

Summary: [RFE] Implement the ability to mirror a transaction between systems within DNF
Product: Red Hat Enterprise Linux 8 Reporter: Kitty <kweg>
Component: dnfAssignee: Lukáš Hrázký <lhrazky>
Status: CLOSED ERRATA QA Contact: Jan Blazek <jblazek>
Severity: high Docs Contact: Mariya Pershina <mpershin>
Priority: medium    
Version: 8.0CC: james.antill, jcastran, kwalker, kweg, lhrazky, mdomonko, mpershin, nsella, pkhedeka, pkratoch, snavale
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: dnf-4.4.2-2.el8 Doc Type: Enhancement
Doc Text:
.The ability to mirror a transaction between systems within DNF is now supported With this update, the user can store and replay a transaction within DNF. * To store a transaction from DNF history into a JSON file, run the `dnf history store` command. * To replay the transaction later on the same machine, or on a different one, run the `dnf history replay` command. Comps groups operations storing and replaying is supported. Module operations are not yet supported, and consequently, are not stored or replayed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:00:34 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:
Bug Depends On: 1887911, 1887916    
Bug Blocks: 1825061, 1894575    

Comment 5 Kyle Walker 2020-03-04 14:20:25 UTC
After discussing the request internally.

The decision was reached to not pursue the load-transaction behaviour directly in the RHEL 8 release. The mechanism was able to be used to mirror a transaction between systems, but it was rather fragile in implementation. It assumed that there were no differences between the transaction start and completion. Any changes to the system since the transaction was generated resulted in the load-transaction failing as shown below:

    # rpm -q bash
    bash-4.2.46-28.el7.x86_64
    
    # yum update bash --assumeno
    Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
    Resolving Dependencies
    --> Running transaction check
    ---> Package bash.x86_64 0:4.2.46-28.el7 will be updated
    ---> Package bash.x86_64 0:4.2.46-33.el7 will be an update
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ============================================================================================================
     Package            Arch                 Version                     Repository                        Size
    ============================================================================================================
    Updating:
     bash               x86_64               4.2.46-33.el7               rhel-7-server-rpms               1.0 M
    
    Transaction Summary
    ============================================================================================================
    Upgrade  1 Package
    
    Total download size: 1.0 M
    Exiting on user command
    Your transaction was saved, rerun it with:
     yum load-transaction /tmp/yum_save_tx.2020-03-04.09-12.X4tL4y.yumtx
    
    # yum update bash-4.2.46-29.el7_4
    Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
    Resolving Dependencies
    --> Running transaction check
    ---> Package bash.x86_64 0:4.2.46-28.el7 will be updated
    ---> Package bash.x86_64 0:4.2.46-29.el7_4 will be an update
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ============================================================================================================
     Package           Arch                Version                        Repository                       Size
    ============================================================================================================
    Updating:
     bash              x86_64              4.2.46-29.el7_4                rhel-7-server-rpms              1.0 M
    
    Transaction Summary
    ============================================================================================================
    Upgrade  1 Package
    
    Total download size: 1.0 M
    Is this ok [y/d/N]: y
    Downloading packages:
    Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
    warning: /var/cache/yum/x86_64/7Server/rhel-7-server-rpms/packages/bash-4.2.46-29.el7_4.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
    Public key for bash-4.2.46-29.el7_4.x86_64.rpm is not installed
    bash-4.2.46-29.el7_4.x86_64.rpm                                                      | 1.0 MB  00:00:00     
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    Importing GPG key 0xFD431D51:
     Userid     : "Red Hat, Inc. (release key 2) <security>"
     Fingerprint: 567e 347a d004 4ade 55ba 8a5f 199e 2f91 fd43 1d51
     Package    : redhat-release-server-7.7-10.el7.x86_64 (@7Server/7.4)
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    Is this ok [y/N]: y
    Importing GPG key 0x2FA658E0:
     Userid     : "Red Hat, Inc. (auxiliary key) <security>"
     Fingerprint: 43a6 e49c 4a38 f4be 9abf 2a53 4568 9c88 2fa6 58e0
     Package    : redhat-release-server-7.7-10.el7.x86_64 (@7Server/7.4)
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    Is this ok [y/N]: y
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Updating   : bash-4.2.46-29.el7_4.x86_64                                                              1/2 
      Cleanup    : bash-4.2.46-28.el7.x86_64                                                                2/2 
      Verifying  : bash-4.2.46-29.el7_4.x86_64                                                              1/2 
      Verifying  : bash-4.2.46-28.el7.x86_64                                                                2/2 
    
    Updated:
      bash.x86_64 0:4.2.46-29.el7_4                                                                             
    
    Complete!
    
    # yum load-transaction /tmp/yum_save_tx.2020-03-04.09-12.X4tL4y.yumtx
    Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
    Error: rpmdb ver mismatched saved transaction version, aborting.


However, the functionality afforded by that mechanism is one that we are currently evaluating internally. As a result, I am renaming this bug to reflect the state of the investigation. Specifically, investigating the possibility of implementing a way to mirror a transaction package target set between two systems. In that mechanism, the intent would be that the above load-transaction example would update the system to the bash-4.2.46-33.el7 version.

Comment 50 Lukáš Hrázký 2021-01-21 10:29:01 UTC
Hello Mariya, I think it's all good now, thanks!

Comment 53 errata-xmlrpc 2021-05-18 15:00:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (dnf bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1657