summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-05-18 01:37:42 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-21 00:32:04 -0700
commitc705b679fbe41aa9ac4486ebf46d3b2ae95d1628 (patch)
treea02d7314bacd0b720fe4b700a000153928d0df42 /xlators/nfs/server/src/nfs.c
parent3b88b2dfbc1a33a6967cfedf63a615ee1e81e49d (diff)
nfs: Introduce trusted-write and trusted-sync options
Introduces two new options: 1. nfs3.*.trusted-write: Forces UNSTABLE writes to return STABLE to NFS clients to prevent the clients from sending a COMMIT. STABLE writes are still handled in a sync manner and so are COMMITs if they're sent at all. 2. nfs3.*.trusted-sync: Forces all WRITEs and COMMITs to return STABLE return flags to NFS clients to avoid the overhead of STABLE writes, and COMMITs that follow UNSTABLE writes. This includes the trusted-write functionality. In addition to the trusted-write, it also writes STABLE writes in an UNSTABLE manner. Both violate the NFS protocol but allow better write perf in most configurations. Use with caution. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 924 (Slow NFS synchronous writes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=924
Diffstat (limited to 'xlators/nfs/server/src/nfs.c')
-rw-r--r--xlators/nfs/server/src/nfs.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index 65ff55c76c1..cb5f19ef992 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -601,6 +601,29 @@ struct volume_options options[] = {
.description = "Type of access desired for this subvolume: "
" read-only, read-write(default)"
},
+ { .key = {"nfs3.*.trusted-write"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .description = "On an UNSTABLE write from client, return STABLE flag"
+ " to force client to not send a COMMIT request. In "
+ "some environments, combined with a replicated "
+ "GlusterFS setup, this option can improve write "
+ "performance. This flag allows user to trust Gluster"
+ " replication logic to sync data to the disks and "
+ "recover when required. COMMIT requests if received "
+ "will be handled in a default manner by fsyncing."
+ " STABLE writes are still handled in a sync manner. "
+ "Off by default."
+
+ },
+ { .key = {"nfs3.*.trusted-sync"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .description = "All writes and COMMIT requests are treated as async."
+ " This implies that no write requests are guaranteed"
+ " to be on server disks when the write reply is "
+ "received at the NFS client. Trusted sync includes "
+ " trusted-write behaviour. Off by default."
+
+ },
{ .key = {"rpc-auth.auth-unix"},
.type = GF_OPTION_TYPE_BOOL,
.description = "Disable or enable the AUTH_UNIX authentication type."