diff options
-rw-r--r-- | libglusterfs/src/globals.h | 5 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-transaction.c | 2 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr.c | 11 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 5 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 6 |
5 files changed, 25 insertions, 4 deletions
diff --git a/libglusterfs/src/globals.h b/libglusterfs/src/globals.h index bbc87f502dd..9231fbc1380 100644 --- a/libglusterfs/src/globals.h +++ b/libglusterfs/src/globals.h @@ -38,7 +38,7 @@ */ #define GD_OP_VERSION_MIN 1 /* MIN is the fresh start op-version, mostly should not change */ -#define GD_OP_VERSION_MAX GD_OP_VERSION_3_13_1 /* MAX VERSION is the maximum +#define GD_OP_VERSION_MAX GD_OP_VERSION_3_13_2 /* MAX VERSION is the maximum count in VME table, should keep changing with introduction of newer @@ -96,6 +96,9 @@ #define GD_OP_VERSION_3_13_1 31301 /* Op-version for GlusterFS 3.13.1 */ +#define GD_OP_VERSION_3_13_2 31302 /* Op-version for GlusterFS 3.13.2 */ + + #define GD_OP_VER_PERSISTENT_AFR_XATTRS GD_OP_VERSION_3_6_0 #include "xlator.h" diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index 7e40bba5b53..ba621204fdc 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -1962,7 +1962,7 @@ afr_set_transaction_flock (xlator_t *this, afr_local_t *local) inodelk = afr_get_inodelk (int_lock, int_lock->domain); priv = this->private; - if (priv->arbiter_count && + if ((priv->arbiter_count || priv->full_lock) && local->transaction.type == AFR_DATA_TRANSACTION) { /*Lock entire file to avoid network split brains.*/ inodelk->flock.l_len = 0; diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index b18f60fcc7c..43389390730 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -244,6 +244,7 @@ reconfigure (xlator_t *this, dict_t *options) out); GF_OPTION_RECONF ("locking-scheme", priv->locking_scheme, options, str, out); + GF_OPTION_RECONF ("full-lock", priv->full_lock, options, bool, out); GF_OPTION_RECONF ("use-compound-fops", priv->use_compound_fops, options, bool, out); @@ -532,6 +533,7 @@ init (xlator_t *this) GF_OPTION_INIT ("pre-op-compat", priv->pre_op_compat, bool, out); GF_OPTION_INIT ("locking-scheme", priv->locking_scheme, str, out); + GF_OPTION_INIT ("full-lock", priv->full_lock, bool, out); GF_OPTION_INIT ("use-compound-fops", priv->use_compound_fops, bool, out); GF_OPTION_INIT ("granular-entry-heal", priv->esh_granular, bool, out); @@ -1088,6 +1090,15 @@ struct volume_options options[] = { "stop being compatible with afr-v1, which helps afr " "be more granular while self-healing", }, + { .key = {"full-lock"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "yes", + .op_version = {GD_OP_VERSION_3_13_2}, + .flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE, + .tags = {"replicate"}, + .description = "If this option is disabled, then the IOs will take " + "range locks same as versions till 3.13.1." + }, { .key = {"granular-entry-heal"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "no", diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 18bf249fa34..dbc9e3cc554 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -177,9 +177,10 @@ typedef struct _afr_private { void *pump_private; gf_boolean_t use_afr_in_pump; char *locking_scheme; - gf_boolean_t esh_granular; + gf_boolean_t full_lock; + gf_boolean_t esh_granular; gf_boolean_t consistent_io; - gf_boolean_t use_compound_fops; + gf_boolean_t use_compound_fops; } afr_private_t; diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index edb31b685c4..9de9cc560fb 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -1506,6 +1506,12 @@ struct volopt_map_entry glusterd_volopt_map[] = { .op_version = GD_OP_VERSION_3_7_12, .flags = VOLOPT_FLAG_CLIENT_OPT }, + { .key = "cluster.full-lock", + .voltype = "cluster/replicate", + .type = NO_DOC, + .op_version = GD_OP_VERSION_3_13_2, + .flags = VOLOPT_FLAG_CLIENT_OPT + }, /* stripe xlator options */ { .key = "cluster.stripe-block-size", |