Bug 2169429

Summary: Handle upgrades to rhel9 with layered packages
Product: Red Hat Enterprise Linux 8 Reporter: Colin Walters <walters>
Component: rpm-ostreeAssignee: RHCOS SST <rhcos-sst>
Status: CLOSED ERRATA QA Contact: HuijingHei <hhei>
Severity: high Docs Contact:
Priority: high    
Version: 8.8CC: hhei, xiaofwan
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpm-ostree-2022.10.112.g3d0ac35b-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 08:24:00 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 Colin Walters 2023-02-13 15:07:13 UTC
Apply https://github.com/coreos/rpm-ostree/pull/4302 so that we handle upgrades to RHEL9 (with the sqlite db backend) in the case where there are layered/overridden packages.

Comment 1 Colin Walters 2023-02-14 13:08:06 UTC
To verify this basically:

Provision a RHEL8 rpm-ostree system (RHCOS, I'd assume Edge too), then layer or override a package (rpm-ostree install etc.).

Then rebase to RHEL9.

Without this change, you should get a failure to write the rpmdb.  With this patch, the rebase should work.

Comment 3 HuijingHei 2023-02-15 07:09:03 UTC
Thanks Colin for the detail instructions.

Verify passed with rpm-ostree-2022.10.112.g3d0ac35b-2.el8 on RHCOS 412.86.202302080410-0 using the steps in Comment 2

Comment 4 Xiaofeng Wang 2023-02-16 12:41:44 UTC
Verified on RHEL for Edge 8.8 to 9.2 with rpm-ostree-2022.10.112.g3d0ac35b-2.el8.rpm.

$ sudo rpm-ostree rebase rhel-edge:rhel/9/x86_64/edge'
2901 metadata, 19309 content objects fetched; 776884 KiB transferred in 22 seconds; 1.3 GB content written
Writing objects: 5...done
Checking out tree ffa81a8...done
Rewriting rpmdb back to host bdb...done
No enabled rpm-md repositories.
Importing rpm-md...done
Resolving dependencies...done
Relabeling...done
Checking out packages...done
Running pre scripts...done
Running post scripts...done
Running posttrans scripts...done
Writing rpmdb...done
Writing OSTree commit...done
Staging deployment...done
Freed: 60.8 MB (pkgcache branches: 1)

Comment 8 HuijingHei 2023-02-27 02:11:13 UTC
Verify passed using rpm-ostree-2022.10.112.g3d0ac35b-3.el8 from RHCOS 412.86.202302231508-0 to centos-stream-coreos-9:4.12-x86_64

[core@cosa-devsh ~]$ rpm -q rpm-ostree
rpm-ostree-2022.10.112.g3d0ac35b-3.el8.x86_64

[root@cosa-devsh ~]# rpm-ostree override remove strace
Checking out tree 2203ba2... done
Resolving dependencies... done
Applying 1 override
Processing packages... done
Writing rpmdb... done
Writing OSTree commit... done
Staging deployment... done
Removed:
  strace-5.13-4.el8.x86_64
Use "rpm-ostree override reset" to undo overrides
Run "systemctl reboot" to start a reboot
[root@cosa-devsh ~]# rpm-ostree status
State: idle
Deployments:
  2203ba2dd29bbde665aed2c18107029f154e87b87fb7c46adf5da2f799a4ad32
                  Version: 412.86.202302231508-0 (2023-02-23T15:12:01Z)
                     Diff: 1 removed
      RemovedBasePackages: strace 5.13-4.el8

* 2203ba2dd29bbde665aed2c18107029f154e87b87fb7c46adf5da2f799a4ad32
                  Version: 412.86.202302231508-0 (2023-02-23T15:12:01Z)

[root@cosa-devsh ~]# rpm-ostree rebase --experimental ostree-unverified-registry:quay.io/okd/centos-stream-coreos-9:4.12-x86_64
[root@cosa-devsh ~]# systemctl reboot
[core@cosa-devsh ~]$ rpm-ostree status
State: idle
Deployments:
● ostree-unverified-registry:quay.io/okd/centos-stream-coreos-9:4.12-x86_64
                   Digest: sha256:3a9d3dfc48c6ad82eab26334fa4cfa2975f54c6842a7c42a48af767aa553835f
                  Version: 412.9.202302230439-0 (2023-02-27T01:50:47Z)
      RemovedBasePackages: strace 5.18-2.el9

  2203ba2dd29bbde665aed2c18107029f154e87b87fb7c46adf5da2f799a4ad32
                  Version: 412.86.202302231508-0 (2023-02-23T15:12:01Z)

Comment 10 errata-xmlrpc 2023-05-16 08:24:00 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 (rpm-ostree 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-2023:2759