Repository navigation
linux-builder-vz: fix nixdb retention; harden registration against gc - #557239
Merged
Merged
Conversation
Otherwise on reboot the builder "forgets" about any store paths present under /nix/store that are not part of the initial registration.
While nix-store --load-db should create missing directories itself, it's better to let tmpfiles service to prepare directories before registration.
Otherwise, if gc later decides to remove registration derivation from its store, consequent reboots will point to a missing registration file. (As of this patch, this is not fatal because registration service failure doesn't fail builder boot; a later patch in the series makes registration service required, making sure we never boot with db that is not populated.)
If there's no store, there's no registration path contained in it.
This guarantees that the builder will never boot without prepared nixdb.
booxter
force-pushed
the
vz-gc-destroyed
branch
from
August 29, 2026 02:34
e69232a to
9e28517
Compare
booxter
marked this pull request as ready for review
August 29, 2026 02:38
Assisted-by: Codex, gpt-5.6-sol medium
Assisted-by: Codex, gpt-5.6-sol medium
This is a qemu based nixos test that attempts to cover configuration resembling real linux-builder-vz disk layout. The test validates that store path referred in kernel cmdline survive gc as well as reboot. (It was actually broken for this builder before recent fixes.) Assisted-by: Codex, gpt-5.6-sol medium
booxter
force-pushed
the
vz-gc-destroyed
branch
from
August 29, 2026 02:40
9e28517 to
954ee96
Compare
nixpkgs-branch-check
Bot
dismissed
their stale review
August 29, 2026 02:49
Review dismissed automatically
Contributor
Author
Contributor
|
@booxter thank you for coming up with this fix! As mentioned in matrix and the vzvm repo, i am completely buried in nixcon preparations. If someone else can help look into this i'm all in for merging, it's just that i don't want to blindly merge it without having ample time to look into it. Maybe @arianvp has capacity to look into this PR? |
arianvp
approved these changes
Sep 12, 2026
4 of 13 tasks
Merged
via the queue into
NixOS:staging-nixos
with commit Sep 19, 2026
0bce973
31 of 33 checks passed
tfc
added a commit
to applicative-systems/vzvm
that referenced
this pull request
Oct 18, 2026
Port the guest-side fixes from NixOS/nixpkgs#557239
tfc
added a commit
to applicative-systems/vzvm
that referenced
this pull request
Oct 18, 2026
Port the guest-side fixes from NixOS/nixpkgs#557239
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The primary goal of this PR is to fix the following VZ builder issue:
This is not theoretical: I am drive-testing this builder for a few weeks and
I hit sudden builder inaccessibility due to this issue - where I couldn't ssh
into the builder, even after I reboot it. Disk image inspection revealed lots
of whiteouts on expected store paths.
The core changes are:
/nixout of tmpfs, making store state survive reboot.The rest are just hardening adjustments for the registration service.
The branch also includes a new nixos test designed to catch regressions for
a configuration that resembles -vz builder (but using qemu), as well as a few
small refactoring patches to make it possible.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.