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

Non-idempotent result of ostree admin upgrade #2389

Closed
RomanValov opened this issue Jun 30, 2021 · 2 comments · Fixed by #2430
Closed

Non-idempotent result of ostree admin upgrade #2389

RomanValov opened this issue Jun 30, 2021 · 2 comments · Fixed by #2430

Comments

@RomanValov
Copy link

If there are no upgrades available run of ostree admin upgrade does nothing.
Subsequent invocations of ostree admin upgrade also does nothing:

[root@ostree ~]# ostree admin upgrade
Receiving metadata objects: 1/(estimating) 98 bytes/s 196 bytes                 
No update available.
[root@ostree ~]# ostree admin upgrade
2 metadata, 0 content objects fetched; 788 B transferred in 3 seconds; 0 bytes content written
No update available.
[root@ostree ~]# ostree admin upgrade
2 metadata, 0 content objects fetched; 788 B transferred in 2 seconds; 0 bytes content written
No update available.
[root@ostree ~]# ostree admin upgrade
2 metadata, 0 content objects fetched; 788 B transferred in 2 seconds; 0 bytes content written
No update available.

If there are existing upgrades they're downloaded and deployed.
Subsequent invocations of ostree admin upgrade updates pending deployment with new deployment number. Thus upgrade command is acting like deploy command:

[root@ostree ~]# ostree admin upgrade
134 metadata, 72 content objects fetched; 76509 KiB transferred in 21 seconds; 90.9 MB content written
Copying /etc changes: 6 modified, 0 removed, 13 added
Bootloader updated; bootconfig swap: yes; bootversion: boot.0.1, deployment count change: 1
[root@ostree ~]# ostree admin upgrade
2 metadata, 0 content objects fetched; 788 B transferred in 3 seconds; 0 bytes content written
Copying /etc changes: 6 modified, 0 removed, 13 added
Transaction complete; bootconfig swap: no; bootversion: boot.0.0, deployment count change: 0
[root@ostree ~]# ostree admin upgrade
2 metadata, 0 content objects fetched; 788 B transferred in 3 seconds; 0 bytes content written
Copying /etc changes: 6 modified, 0 removed, 13 added
Transaction complete; bootconfig swap: no; bootversion: boot.0.1, deployment count change: 0
[root@ostree ~]# ostree admin upgrade
2 metadata, 0 content objects fetched; 788 B transferred in 2 seconds; 0 bytes content written
Copying /etc changes: 6 modified, 0 removed, 13 added
Transaction complete; bootconfig swap: no; bootversion: boot.0.0, deployment count change: 0
[root@ostree ~]# ls -l /ostree/deploy/fedora-iot/deploy/
total 16
drwxr-xr-x. 11 root root 4096 Jun 30 20:16 0af775ea3146c32c7dd4a51cee78c9eb60da704035b9e3845a26469fea78bdc7.3
-rw-r--r--.  1 root root   53 Jun 30 20:16 0af775ea3146c32c7dd4a51cee78c9eb60da704035b9e3845a26469fea78bdc7.3.origin
drwxr-xr-x. 11 root root 4096 Jun 30 20:14 58bcb3f5742dfe1390c71cf5903fe596bc51a54073e8e5642a2e55b88cbf029f.0
-rw-r--r--.  1 root root   53 Jun 30 20:14 58bcb3f5742dfe1390c71cf5903fe596bc51a54073e8e5642a2e55b88cbf029f.0.origin

Once upgrade commit is deployed subsequent invocations of ostree admin upgrade should do nothing.

@jlebon
Copy link
Member

jlebon commented Jul 5, 2021

Yeah, this is something that rpm-ostree has switched to doing a long time ago. Essentially, we use the default deployment (i.e. the pending deployment if you've just created a new one like here) as the "origin source", and that includes the base checksum to use when doing additional transformations like e.g. rpm-ostree install foobar. It would make sense to fold this into ostree's sysroot upgrader.

cgwalters added a commit to cgwalters/ostree that referenced this issue Sep 2, 2021
We're waaay overdue for this, it's been the default
in rpm-ostree for years, and solves several important bugs
around not capturing `/etc` while things are running.

Also, `ostree admin upgrade --stage` becomes idempotent.

Closes: ostreedev#2389
cgwalters added a commit to cgwalters/ostree that referenced this issue Sep 2, 2021
We're waaay overdue for this, it's been the default
in rpm-ostree for years, and solves several important bugs
around not capturing `/etc` while things are running.

Also, `ostree admin upgrade --stage` (should) become idempotent.

Closes: ostreedev#2389
@cgwalters
Copy link
Member

This is really about staging I think. The reason we re-run is to pick up any changes in /etc. But that only applies if not staging.

I filed #2430

cgwalters added a commit to cgwalters/ostree that referenced this issue Sep 7, 2021
We're waaay overdue for this, it's been the default
in rpm-ostree for years, and solves several important bugs
around not capturing `/etc` while things are running.

Also, `ostree admin upgrade --stage` (should) become idempotent.

Closes: ostreedev#2389
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants