Bug 2144586
| Summary: | Previous container images are not GC'd by default | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Colin Walters <walters> |
| Component: | rpm-ostree | Assignee: | Colin Walters <walters> |
| Status: | CLOSED ERRATA | QA Contact: | HuijingHei <hhei> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 9.2 | CC: | aaradhak, hhei, qzhang |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | rpm-ostree-2022.16-2.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-05-09 07:23:50 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
2022-11-21 18:58:19 UTC
The primary change here is https://github.com/coreos/rpm-ostree/pull/4138 To verify, use e.g. `rpm-ostree rebase` to different container images. In versions before this, you will see the *old* image listed in `ostree container image list --repo=/ostree/repo`. After applying this update, the previous image should no longer be displayed and hence its data will be garbage collected. To do a deeper verification, try rebooting into the new system, run `rpm-ostree cleanup -r`, then look in `/ostree/repo/objects` for a file/object that was only present in the *old* image. Verify passed with rpm-ostree-2022.16-2.el9.x86_64 using rhcos (with rhel9.0). 1) Test with old rpm-ostree-2022.14-1.el9, after rebase 2 different images, get the 2 images listed in `ostree container image list --repo=/ostree/repo`. After reboot and run `rpm-ostree cleanup -r`, the old files are still existed in repo. [root@cosa-devsh ~]# rpm -qa | grep rpm-ostree rpm-ostree-libs-2022.14-1.el9.x86_64 rpm-ostree-2022.14-1.el9.x86_64 [root@cosa-devsh ~]# rpm-ostree rebase --experimental ostree-unverified-registry:registry.ci.openshift.org/coreos/hhei-rhcos-test:9 [root@cosa-devsh ~]# rpm-ostree rebase --experimental ostree-unverified-registry:registry.ci.openshift.org/coreos/hhei-rhcos-test:9-new [root@cosa-devsh ~]# ostree container image list --repo=/ostree/repo docker://registry.ci.openshift.org/coreos/hhei-rhcos-test:9-new docker://registry.ci.openshift.org/coreos/hhei-rhcos-test:9 # reboot [root@cosa-devsh ~]# find /sysroot/ -inum 5566165 /sysroot/ostree/repo/objects/34/75f4995af551e300f34e2c6609abf9bf9c1d346b1aebc993090ff8451744a9.file /sysroot/ostree/deploy/rhcos/deploy/cd9e5050e984ce843f2f691f6c2f4e08d69d0e89e274810df466b2180f695dc7.0/usr/bin/ostree [root@cosa-devsh ~]# rpm-ostree cleanup -r Bootloader updated; bootconfig swap: yes; bootversion: boot.1.1, deployment count change: -1 Freed: 124.1?MB (pkgcache branches: 0) [root@cosa-devsh ~]# find /sysroot/ -inum 5566165 /sysroot/ostree/repo/objects/34/75f4995af551e300f34e2c6609abf9bf9c1d346b1aebc993090ff8451744a9.file ============================================================================ 2) Test with fixed rpm-ostree, after rebase 2 different images, only get the latest image listed in `ostree container image list --repo=/ostree/repo`. After reboot and run `rpm-ostree cleanup -r`, the old files are removed in repo [core@cosa-devsh ~]$ rpm -qa | grep rpm-ostree rpm-ostree-libs-2022.16-2.el9.x86_64 rpm-ostree-2022.16-2.el9.x86_64 [root@cosa-devsh ~]# rpm-ostree rebase --experimental ostree-unverified-registry:registry.ci.openshift.org/coreos/hhei-rhcos-test:9 [root@cosa-devsh ~]# rpm-ostree rebase --experimental ostree-unverified-registry:registry.ci.openshift.org/coreos/hhei-rhcos-test:9-new [root@cosa-devsh ~]# ostree container image list --repo=/ostree/repo docker://registry.ci.openshift.org/coreos/hhei-rhcos-test:9-new # reboot [root@cosa-devsh ~]# find /sysroot/ -inum 5566795 /sysroot/ostree/repo/objects/34/75f4995af551e300f34e2c6609abf9bf9c1d346b1aebc993090ff8451744a9.file /sysroot/ostree/deploy/rhcos/deploy/35447b0acf046b272501b00726834738546af9cac7555d96c7c4e887a84c3215.0/usr/bin/ostree [root@cosa-devsh ~]# rpm-ostree cleanup -r Bootloader updated; bootconfig swap: yes; bootversion: boot.1.1, deployment count change: -1 Freed: 127.0?MB (pkgcache branches: 0) [root@cosa-devsh ~]# find /sysroot/ -inum 5566795 Thanks Colin for the pointer, change status to VERIFIED according to result in Comment 2. 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/RHEA-2023:2164 |