diff options
author | Niels de Vos <ndevos@redhat.com> | 2015-06-21 15:07:58 +0200 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-07-07 09:11:58 -0700 |
commit | 3cf776c49bc60b7f616a4c503a8b10b2d19ad04b (patch) | |
tree | c4b8d728406ffcedee4a4bbb851ddbac380d7e89 /xlators/nfs/server/src/nfs.c | |
parent | c9e92231e8fb31e6e4a9f061746daaedd77ad1b7 (diff) |
nfs: make it possible to disable nfs.mount-rmtab
When there are many NFS-clients doing very often mount/unmount actions,
the updating of the 'rmtab' can become a bottleneck and cause delays. In
these situations, the output of 'showmount' may be less important than
the responsiveness of the (un)mounting.
By setting 'nfs.mount-rmtab' to the value "/-", the cache file is not
updated anymore, and the entries are only kept in memory.
Cherry picked from commit 40407afb529f6e5fa2f79e9778c2f527122d75eb:
> Cherry picked from commit 331ef6e1a86bfc0a93f8a9dec6ad35c417873849:
>> BUG: 1169317
>> Change-Id: I40c4d8d754932f86fb2b1b2588843390464c773d
>> Reported-by: Cyril Peponnet <cyril@peponnet.fr>
>> Signed-off-by: Niels de Vos <ndevos@redhat.com>
>> Reviewed-on: http://review.gluster.org/9223
>> Tested-by: Gluster Build System <jenkins@build.gluster.com>
>> Reviewed-by: soumya k <skoduri@redhat.com>
>> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
>> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
>
> This change also contains the fixes to the test-case from:
>>
>> nfs: fix spurious failure in bug-1166862.t
>>
>> In some environments, "showmount" could return an NFS-client that does
>> not start with "1". This would cause the test-case to fail. The check is
>> incorrect, the number of lines should get counted instead.
>>
>> Also moving the test-case to the .../nfs/... subdirectory.
>>
>> Cherry picked from commit ee9b35a780607daddc2832b9af5ed6bf414aebc0:
>> BUG: 1166862
>> Change-Id: Ic03aa8145ca57d78aea01564466e924b03bb302a
>> Signed-off-by: Niels de Vos <ndevos@redhat.com>
>> Reviewed-on: http://review.gluster.org/10419
>> Tested-by: Gluster Build System <jenkins@build.gluster.com>
>> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
>>
>
> Change-Id: I40c4d8d754932f86fb2b1b2588843390464c773d
> BUG: 1215385
> Signed-off-by: Niels de Vos <ndevos@redhat.com>
> Reviewed-on: http://review.gluster.org/10379
> Tested-by: NetBSD Build System
> Tested-by: Gluster Build System <jenkins@build.gluster.com>
> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
GLUSTERD_WORKDIR has been added to tests/include.rc and is not
configurable through ./configure like on newer branches. It is not
suitable to change the GlusterD working directory in an update for a
stable release.
Change-Id: I40c4d8d754932f86fb2b1b2588843390464c773d
BUG: 1166862
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11336
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs.c')
-rw-r--r-- | xlators/nfs/server/src/nfs.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 928754917c1..1be6caa7b5e 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -881,6 +881,12 @@ nfs_init_state (xlator_t *this) gf_log (GF_NFS, GF_LOG_ERROR, "Failed to parse dict"); goto free_foppool; } + + /* check if writing the rmtab is disabled*/ + if (nfs->rmtab && strcmp ("/-", nfs->rmtab) == 0) { + GF_FREE (nfs->rmtab); + nfs->rmtab = NULL; + } } /* support both options rpc-auth.ports.insecure and @@ -1079,7 +1085,13 @@ nfs_reconfigure_state (xlator_t *this, dict_t *options) } gf_path_strip_trailing_slashes (optstr); } - if (strcmp (nfs->rmtab, optstr) != 0) { + /* check if writing the rmtab is disabled*/ + if (strcmp ("/-", optstr) == 0) { + GF_FREE (nfs->rmtab); + nfs->rmtab = NULL; + gf_log (GF_NFS, GF_LOG_INFO, + "Disabled writing of nfs.mount-rmtab"); + } else if (!nfs->rmtab || strcmp (nfs->rmtab, optstr) != 0) { mount_rewrite_rmtab (nfs->mstate, optstr); gf_log (GF_NFS, GF_LOG_INFO, "Reconfigured nfs.mount-rmtab path: %s", @@ -1817,7 +1829,8 @@ struct volume_options options[] = { "list all the NFS-clients that have connected " "through the MOUNT protocol. If this is on shared " "storage, all GlusterFS servers will update and " - "output (with 'showmount') the same list." + "output (with 'showmount') the same list. Set to " + "\"/-\" to disable." }, { .key = {OPT_SERVER_AUX_GIDS}, .type = GF_OPTION_TYPE_BOOL, |