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

zpool-trim.service fails by default in NixOS 20.03 in many scenarios #81602

Closed
yesbox opened this issue Mar 3, 2020 · 1 comment · Fixed by #81610
Closed

zpool-trim.service fails by default in NixOS 20.03 in many scenarios #81602

yesbox opened this issue Mar 3, 2020 · 1 comment · Fixed by #81610

Comments

@yesbox
Copy link
Contributor

yesbox commented Mar 3, 2020

Describe the bug
zpool-trim.service attempts to trim pools regardless of them being trimmable or not and whether a pool is currently being trimmed or not. This has several problems. I will herby refer to the two types as HDD (non-trimmable) and SSD (trimmable) for short.

  • If the system contains both HDD pools and SSD pools and a HDD pool is listed before all SSD pools in "zpool list", the service will abort after the first HDD pool is hit and the SSD pools will never be trimmed.

  • If the system contains only SSD pools the trim of all SSD pools may still fail if one SSD pool is currently being trimmed. Issuing the trim command to a pool already being trimmed will fail and the service will abort before issuing the trim command to all SSD pools.

  • If the system contains only HDD pools the service which is now enabled by default in NixOS 20.03 will now periodically fail, putting the entire system in a degraded systemd state. This is a NixOS 20.03 regression.

To Reproduce
Steps to reproduce the behavior:
Recreate any of the scenarios described above. All errors return 255 and can be simulated by replacing a pool name with a non-existent pool name, which also returns 255.

Expected behavior
Either:

  • zpool-trim.service should trim all SSD pools and should not degrade the system by default. This could be implemented by having zpool-trim.service ignore the exit code of every "zpool trim " command it issues.
  • zpool-trim.service should be disabled by default and it be documented that it only support systems containing exclusively SSD pools.

Metadata

  • system: "x86_64-linux"
  • host os: Linux 5.4.23, NixOS, 20.03.git.893d745d5a0 (Markhor)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.2

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
  - nixos/modules/tasks/filesystems/zfs.nix
@yesbox yesbox changed the title zpool-trim.service fails on in many scenarios by default zpool-trim.service fails by default in many scenarios Mar 3, 2020
@yesbox yesbox changed the title zpool-trim.service fails by default in many scenarios zpool-trim.service fails by default in NixOS 20.03 in many scenarios Mar 3, 2020
@yesbox
Copy link
Contributor Author

yesbox commented Mar 3, 2020

Ping @Mic92

Mic92 added a commit to Mic92/nixpkgs that referenced this issue Mar 3, 2020
@veprbl veprbl added this to the 20.03 milestone Mar 3, 2020
Mic92 added a commit that referenced this issue Mar 4, 2020
fixes #81602

(cherry picked from commit 557989c460e386d0abca068245806a2fbc89edf0)
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this issue Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants