summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2014-06-09 09:57:37 +0200
committerNiels de Vos <ndevos@redhat.com>2014-06-10 02:37:13 -0700
commitde19f3952b9e9a22db9b4af55e74b557aa71bae9 (patch)
tree5b897219b6f4313c7899dd6b234cc75190d7956f
parent6648b92e980c9d59c719a461b37951109839182e (diff)
gNFS: Make NFS DRC off by default
DRC in NFS causes memory bloat and there are known memory corruptions. It would be good to disable drc by default till the feature is stable. Cherry picked from 4215d071cec4fc8a62ca4fd6212d83f931838829: > Change-Id: I93db6ef5298672c56fb117370bb582a5e5550b17 > BUG: 1105524 > Original-patch-by: Santosh Kumar Pradhan <spradhan@redhat.com> > Signed-off-by: Niels de Vos <ndevos@redhat.com> > Reviewed-on: http://review.gluster.org/8004 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> > Reviewed-by: Santosh Pradhan <spradhan@redhat.com> > Reviewed-by: Vijay Bellur <vbellur@redhat.com> Change-Id: I93db6ef5298672c56fb117370bb582a5e5550b17 BUG: 1105524 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/8013 Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--rpc/rpc-lib/src/rpc-drc.c22
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c2
-rw-r--r--xlators/nfs/server/src/nfs.c2
3 files changed, 13 insertions, 13 deletions
diff --git a/rpc/rpc-lib/src/rpc-drc.c b/rpc/rpc-lib/src/rpc-drc.c
index e7ba114dd27..04b17f00860 100644
--- a/rpc/rpc-lib/src/rpc-drc.c
+++ b/rpc/rpc-lib/src/rpc-drc.c
@@ -731,11 +731,12 @@ rpcsvc_drc_init (rpcsvc_t *svc, dict_t *options)
}
/* Toggle DRC on/off, when more drc types(persistent/cluster)
- are added, we shouldn't treat this as boolean */
- ret = dict_get_str_boolean (options, "nfs.drc", _gf_true);
+ * are added, we shouldn't treat this as boolean. */
+ ret = dict_get_str_boolean (options, "nfs.drc", _gf_false);
if (ret == -1) {
- gf_log (GF_RPCSVC, GF_LOG_INFO, "drc user options need second look");
- ret = _gf_true;
+ gf_log (GF_RPCSVC, GF_LOG_INFO,
+ "drc user options need second look");
+ ret = _gf_false;
}
if (ret == _gf_false) {
@@ -872,12 +873,12 @@ rpcsvc_drc_reconfigure (rpcsvc_t *svc, dict_t *options)
* case 2: DRC is "OFF"
* ACTION: rpcsvc_drc_deinit()
*/
- ret = dict_get_str_boolean (options, "nfs.drc", _gf_true);
- if (ret < 0) {
- enable_drc = _gf_true;
- } else {
- enable_drc = ret;
- }
+ ret = dict_get_str_boolean (options, "nfs.drc", _gf_false);
+ if (ret < 0)
+ ret = _gf_false;
+
+ enable_drc = ret;
+ gf_log (GF_RPCSVC, GF_LOG_INFO, "DRC is turned %s", (ret?"ON":"OFF"));
/* case 1: DRC is "ON"*/
if (enable_drc) {
@@ -895,6 +896,5 @@ rpcsvc_drc_reconfigure (rpcsvc_t *svc, dict_t *options)
}
/* case 2: DRC is "OFF" */
- gf_log (GF_RPCSVC, GF_LOG_INFO, "DRC is manually turned OFF");
return rpcsvc_drc_deinit (svc);
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 31af116621c..e5f03701284 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -3017,7 +3017,7 @@ build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict)
if (ret)
goto out;
- ret = xlator_set_option (nfsxl, "nfs.drc", "on");
+ ret = xlator_set_option (nfsxl, "nfs.drc", "off");
if (ret)
goto out;
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index bd62b5d4cad..4ecc5be0cd0 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -1844,7 +1844,7 @@ struct volume_options options[] = {
},
{ .key = {"nfs.drc"},
.type = GF_OPTION_TYPE_STR,
- .default_value = "on",
+ .default_value = "off",
.description = "Enable Duplicate Request Cache in gNFS server to "
"improve correctness of non-idempotent operations like "
"write, delete, link, et al"