Skip to content

Fix silent upgrade failure on container systems#5569

Merged
jmarrero merged 1 commit intocoreos:mainfrom
jmarrero:fix-upgrade-silent-failure
Mar 10, 2026
Merged

Fix silent upgrade failure on container systems#5569
jmarrero merged 1 commit intocoreos:mainfrom
jmarrero:fix-upgrade-silent-failure

Conversation

@jmarrero
Copy link
Copy Markdown
Member

@jmarrero jmarrero commented Mar 9, 2026

Fix silent upgrade failure on container systems
PR #5510 introduced an early return for container-based deployments
to handle idempotent package layering, but it failed to check whether
the base image itself had changed. This caused rpm-ostree upgrade
to silently return success without staging a new deployment.

Fold remove_changed and override_changed into the changed
variable so the early return only triggers when truly nothing changed.

Also fix a related crash in rpmostree_context_assemble() when
--idempotent --apply-live is used on a package already in the base
image: the empty transaction path hit g_assert_not_reached() instead
of returning through rpmostree_context_assemble_end().

Closes: #5567
Fixes: 4d4196e ("rpmostreed-transaction-types: don't use base-db when idempotent")
Assisted-by: Claude Opus 4.6 (OpenCode)
Signed-off-by: Joseph Marrero Corchado jmarrero@redhat.com

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a silent failure during rpm-ostree upgrade on container-based systems that have no layered packages. The core fix in src/daemon/rpmostreed-transaction-types.cxx correctly checks for base image changes to prevent an erroneous early exit, which is the right approach. The changes in rust/src/sysroot_upgrade.rs are a nice UX improvement for progress reporting. The new test cases in tests/kolainst/destructive/idempotent-layering are comprehensive and provide excellent regression coverage for the fixed issue. I have one suggestion to improve the robustness and clarity of the test script.

Comment thread tests/kolainst/destructive/idempotent-layering Outdated
Comment thread src/daemon/rpmostreed-transaction-types.cxx Outdated
@cgwalters
Copy link
Copy Markdown
Member

You already have the progress fix in another PR, so let's drop it from this one since it's unrelated.

I would then squash the fix and test commits (the test commit message is pretty verbose IMO, don't need to explain every change in the commit msg).

@jmarrero
Copy link
Copy Markdown
Member Author

jmarrero commented Mar 9, 2026

Yeah opened the other PR because this is not passing the test yet. I will update this PR with just one commit once I get the fix to actually work locally.

@jmarrero jmarrero marked this pull request as draft March 9, 2026 18:55
@jmarrero jmarrero force-pushed the fix-upgrade-silent-failure branch 2 times, most recently from 3050488 to 68437db Compare March 9, 2026 20:56
@jmarrero
Copy link
Copy Markdown
Member Author

jmarrero commented Mar 9, 2026

/gemini review

@jmarrero jmarrero force-pushed the fix-upgrade-silent-failure branch from 68437db to bb64952 Compare March 9, 2026 20:57
@jmarrero jmarrero changed the title Fix upgrade silent failure Fix silent upgrade failure on container systems Mar 9, 2026
@jmarrero jmarrero marked this pull request as ready for review March 9, 2026 21:06
Comment thread tests/kolainst/destructive/idempotent-layering
@jmarrero jmarrero marked this pull request as draft March 9, 2026 21:14
Comment thread src/daemon/rpmostreed-transaction-types.cxx Outdated
Comment thread tests/kolainst/destructive/idempotent-layering Outdated
Comment thread src/libpriv/rpmostree-core.cxx
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a silent upgrade failure by correcting the change detection logic in rpmostreed-transaction-types.cxx and allowing empty transactions to proceed in rpmostree-core.cxx. These changes ensure that upgrades, especially for container-based systems, are correctly staged even when no new packages are layered. The addition of extensive regression tests in tests/kolainst/destructive/idempotent-layering is a great way to verify the fix and prevent future regressions. The changes look solid. I have one suggestion to improve the robustness of the test script.

Comment thread tests/kolainst/destructive/idempotent-layering Outdated
PR coreos#5510 introduced an early return for container-based deployments
to handle idempotent package layering, but it failed to check whether
the base image itself had changed. This caused `rpm-ostree upgrade`
to silently return success without staging a new deployment.

Fold `remove_changed` and `override_changed` into the `changed`
variable so the early return only triggers when truly nothing changed.

Also fix a related crash in `rpmostree_context_assemble()` when
`--idempotent --apply-live` is used on a package already in the base
image: the empty transaction path hit `g_assert_not_reached()` instead
of returning through `rpmostree_context_assemble_end()`.

Closes: coreos#5567
Fixes: 4d4196e ("rpmostreed-transaction-types: don't use base-db when idempotent")
Assisted-by: Claude Opus 4.6 (OpenCode)
Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
@jmarrero jmarrero force-pushed the fix-upgrade-silent-failure branch from bb64952 to 2429032 Compare March 9, 2026 22:28
@jmarrero jmarrero marked this pull request as ready for review March 9, 2026 22:28
@jmarrero jmarrero merged commit 21fb11a into coreos:main Mar 10, 2026
16 of 18 checks passed
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 this pull request may close these issues.

Critical silent failure in rpm-ostree upgrade prevents upgrading

2 participants