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: Enable choosing pools #73322

Closed

Conversation

ElvishJerricco
Copy link
Contributor

Motivation for this change

Unlike services.zfs.autoScrub, you can't choose which pools to affect with services.zfs.trim. This was an issue for me when my HDD pool caused any userland zfs/zpool processes to hang for some reason while it tried to trim the HDD pool (and failed after 5min, probably from systemd killing it, which then allowed the userland processes to continue). When I used this patch to only trim my SSD pool, everything went fine.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @Mic92, is this a good enough reason to go back to script from ExecStart? I could do it with a one-liner, but it just seemed very messy.

@ElvishJerricco
Copy link
Contributor Author

Also, is this the sort of thing that's acceptable to backport to 19.09?

@Mic92
Copy link
Member

Mic92 commented Mar 14, 2020

Do you still need this option after #81610 has been added?

@kmcopper
Copy link
Contributor

kmcopper commented Apr 1, 2020

This is still useful to prevent the errors from happening in the first place. This can also speed up the loop if you only want specific pools trimmed.

@Mic92
Copy link
Member

Mic92 commented Apr 1, 2020

It no longer should break on errors. I also don't see how speed is a concern when this loop runs only once a week.

@Mic92 Mic92 closed this Apr 1, 2020
@kmcopper
Copy link
Contributor

kmcopper commented Apr 2, 2020

It was more about efficiency and lack of polluting logs with error messages to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants