Consider preventing store corruption by default #531

Open
opened 2024-09-24 07:21:56 +00:00 by sersorrel · 1 comment

If the system shuts down uncleanly, it's possible to corrupt the contents of /nix/store (e.g. ending up with zero-length .nix files, which invariably cause eval errors).

Describe the solution you'd like

I'd like Lix to support the fsync-store-paths option (see https://github.com/NixOS/nix/pull/7126), which I suspect was merged into Nix after Lix was forked off.

I'd also like the note in that PR whereby "Local builds can still result in non-fsynced writes to the nix store." to be addressed somehow.

Describe alternatives you've considered

I could enable sync-before-registering, but this apparently (I have not yet verified) has a large performance impact.

I believe Lix should, in the interests of correctness, default to whatever behaviour will avoid store corruption on unclean shutdown.

Additional context

## Is your feature request related to a problem? Please describe. If the system shuts down uncleanly, it's possible to corrupt the contents of /nix/store (e.g. ending up with zero-length .nix files, which invariably cause eval errors). ## Describe the solution you'd like I'd like Lix to support the fsync-store-paths option (see https://github.com/NixOS/nix/pull/7126), which I suspect was merged into Nix after Lix was forked off. I'd also like the note in that PR whereby "Local builds can still result in non-fsynced writes to the nix store." to be addressed somehow. ## Describe alternatives you've considered I could enable sync-before-registering, but this apparently (I have not yet verified) has a large performance impact. I believe Lix should, in the interests of correctness, default to whatever behaviour will avoid store corruption on unclean shutdown. ## Additional context
Member

I've submitted a patch that ports fsync-store-paths

I've submitted a [patch](https://gerrit.lix.systems/c/lix/+/2048) that ports `fsync-store-paths`
jade added the
stability
label 2024-10-20 00:58:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#531
No description provided.