summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-03-17 13:16:45 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-03-25 01:58:53 -0700
commit6477c13c63e181dec4f034d8d25435026550d93a (patch)
tree606d8e9acbe88a90fd0b33ea6f09eb033c0c8aa1
parente4d8dc2e80f0683c69481c47875c01c8c3723814 (diff)
cluster/afr: Make read child match check in afr optional
Backport of: http://review.gluster.org/9917 Having this particular check which was introduced by commit c57c455347a72ebf0085add49ff59aae26c7a70d causes a drop in performance in readdirp. So the behavior is made configurable with this patch. Change-Id: I4a19813cfc786504340264a5a5533a0c43a1d4a4 BUG: 1202673 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9929 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
-rw-r--r--libglusterfs/src/globals.h4
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c4
-rw-r--r--xlators/cluster/afr/src/afr.c16
-rw-r--r--xlators/cluster/afr/src/afr.h1
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c6
5 files changed, 30 insertions, 1 deletions
diff --git a/libglusterfs/src/globals.h b/libglusterfs/src/globals.h
index 44568406abf..2e4efffc243 100644
--- a/libglusterfs/src/globals.h
+++ b/libglusterfs/src/globals.h
@@ -36,12 +36,14 @@
*/
#define GD_OP_VERSION_MIN 1 /* MIN is the fresh start op-version, mostly
should not change */
-#define GD_OP_VERSION_MAX 30600 /* MAX VERSION is the maximum count in VME
+#define GD_OP_VERSION_MAX 30603 /* MAX VERSION is the maximum count in VME
table, should keep changing with
introduction of newer versions */
#define GD_OP_VERSION_3_6_0 30600 /* Op-Version for GlusterFS 3.6.0 */
+#define GD_OP_VERSION_3_6_3 30603 /* Op-Version for GlusterFS 3.6.3 */
+
#define GD_OP_VER_PERSISTENT_AFR_XATTRS GD_OP_VERSION_3_6_0
#include "xlator.h"
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index 28bf89f2842..984ed9c6095 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -149,6 +149,10 @@ afr_validate_read_subvol (inode_t *inode, xlator_t *this, int par_read_subvol)
* either afr_data_subvol_get() or afr_metadata_subvol_get() would
* yield the same result. Hence, choosing afr_data_subvol_get() below.
*/
+
+ if (!priv->consistent_metadata)
+ return 0;
+
entry_read_subvol = afr_data_subvol_get (inode, this, 0, 0);
if (entry_read_subvol != par_read_subvol)
return -1;
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index 2c0ff05fd78..1382f266872 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -200,6 +200,9 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("iam-self-heal-daemon", priv->shd.iamshd, options,
bool, out);
+ GF_OPTION_RECONF ("consistent-metadata", priv->consistent_metadata,
+ options, bool, out);
+
priv->did_discovery = _gf_false;
ret = 0;
@@ -347,6 +350,9 @@ init (xlator_t *this)
GF_OPTION_INIT ("iam-self-heal-daemon", priv->shd.iamshd, bool, out);
+ GF_OPTION_INIT ("consistent-metadata", priv->consistent_metadata, bool,
+ out);
+
priv->wait_count = 1;
priv->child_up = GF_CALLOC (sizeof (unsigned char), child_count,
@@ -749,5 +755,15 @@ struct volume_options options[] = {
.type = GF_OPTION_TYPE_BOOL,
.default_value = "off",
},
+ { .key = {"consistent-metadata"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "no",
+ .description = "If this option is enabled, readdirp will force "
+ "lookups on those entries read whose read child is "
+ "not the same as that of the parent. This will "
+ "guarantee that all read operations on a file serve "
+ "attributes from the same subvol as long as it holds "
+ " a good copy of the file/dir.",
+ },
{ .key = {NULL} },
};
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 4044fd59d4e..9448471752b 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -124,6 +124,7 @@ typedef struct _afr_private {
/* pump dependencies */
void *pump_private;
gf_boolean_t use_afr_in_pump;
+ gf_boolean_t consistent_metadata;
} afr_private_t;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index dc620067ec4..0ed5b316c4f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -564,6 +564,12 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.op_version = 3,
.flags = OPT_FLAG_CLIENT_OPT
},
+ { .key = "cluster.consistent-metadata",
+ .voltype = "cluster/replicate",
+ .type = DOC,
+ .op_version = GD_OP_VERSION_3_6_3,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
/* Stripe xlator options */
{ .key = "cluster.stripe-block-size",