diff options
| -rw-r--r-- | libglusterfs/src/globals.h | 4 | ||||
| -rw-r--r-- | xlators/cluster/afr/src/afr-dir-read.c | 4 | ||||
| -rw-r--r-- | xlators/cluster/afr/src/afr.c | 16 | ||||
| -rw-r--r-- | xlators/cluster/afr/src/afr.h | 1 | ||||
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 6 | 
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",  | 
