From d32d15df38269f7fc0df6cad2774b0f50119fea4 Mon Sep 17 00:00:00 2001 From: Christian Theune Date: Thu, 26 Sep 2024 07:32:05 +0200 Subject: [PATCH] nfs: switch to hard recovery to avoid potential data consistency issues We discovered that soft ist a sub-optimal setting but was initially set due to recovery issues. Having investigated the current issue we decided to switch back to hard. Re PL-133015 --- nixos/roles/nfs.nix | 14 +++++++++++--- tests/nfs.nix | 13 ++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/nixos/roles/nfs.nix b/nixos/roles/nfs.nix index 3edbdcd4f..1de84f360 100644 --- a/nixos/roles/nfs.nix +++ b/nixos/roles/nfs.nix @@ -73,15 +73,23 @@ in (lib.mkIf (cfg.roles.nfs_rg_client.enable && service != null) { fileSystems = { - # WARNING: those settings are duplicated in the tests to - # fix a deficiency of the test harness. "${mountpoint}" = { device = "${service.address}:${export}"; fsType = "nfs4"; + ############################################################# + # WARNING: those settings are DUPLICATED in tests/nfs.nix to + # work around a deficiency of the test harness. + ############################################################# options = [ "rw" "noauto" - "soft" + # Retry infinitely + "hard" + # Start over the retry process after 10 tries + "retrans=10" + # Start with a 3s (30 deciseconds) interval and add 3s as linear + # backoff + "timeo=30" "rsize=8192" "wsize=8192" "nfsvers=4" diff --git a/tests/nfs.nix b/tests/nfs.nix index 8bd3744a0..de2e9cb60 100644 --- a/tests/nfs.nix +++ b/tests/nfs.nix @@ -59,9 +59,20 @@ in { "${cdir}" = { device = "server:${sdir}"; fsType = "nfs4"; + ################################################################ + # WARNING: those settings are DUPLICATED in nixos/roles/nfs.nix + # to work around a deficiency of the test harness. + ################################################################ options = [ "rw" - "soft" + "noauto" + # Retry infinitely + "hard" + # Start over the retry process after 10 tries + "retrans=10" + # Start with a 3s (30 deciseconds) interval and add 3s as linear + # backoff + "timeo=30" "rsize=8192" "wsize=8192" "nfsvers=4"