summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2012-06-26 21:06:39 -0700
committerAnand Avati <avati@redhat.com>2012-07-04 00:17:47 -0700
commit5a3d849b8563067d35c1422e43e605bd9533f3c2 (patch)
tree3af92a855743679a9f693a5ea9c35df67ff9c5dd /xlators/cluster/afr/src/afr.c
parentd90596a15c03434f14258d754e37b84e3ec57310 (diff)
cluster/afr: post-op-delay support
post-op-delay introduces an artificial delay between the OP and POST-OP-CHANGELOG phases of a write transaction to increase the probability of changelog-piggyback and eager-locking to work more efficiently. Also enable eager-locking by default. Change-Id: I865ca4b68512c44818719c7e388952f15d53e6c2 BUG: 836033 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3621 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index cd84c357da8..108c82778db 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -183,6 +183,9 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("heal-timeout", priv->shd.timeout, options,
int32, out);
+ GF_OPTION_RECONF ("post-op-delay-secs", priv->post_op_delay_secs, options,
+ uint32, out);
+
/* Reset this so we re-discover in case the topology changed. */
priv->did_discovery = _gf_false;
@@ -324,6 +327,8 @@ init (xlator_t *this)
GF_OPTION_INIT ("quorum-count", priv->quorum_count, uint32, out);
fix_quorum_options(this,priv,qtype);
+ GF_OPTION_INIT ("post-op-delay-secs", priv->post_op_delay_secs, uint32, out);
+
priv->wait_count = 1;
priv->child_up = GF_CALLOC (sizeof (unsigned char), child_count,
@@ -617,7 +622,7 @@ struct volume_options options[] = {
},
{ .key = {"eager-lock"},
.type = GF_OPTION_TYPE_BOOL,
- .default_value = "off",
+ .default_value = "on",
},
{ .key = {"self-heal-daemon"},
.type = GF_OPTION_TYPE_BOOL,
@@ -657,5 +662,14 @@ struct volume_options options[] = {
.default_value = "600",
.description = "Poll timeout for checking the need to self-heal"
},
+ { .key = {"post-op-delay-secs"},
+ .type = GF_OPTION_TYPE_INT,
+ .min = 0,
+ .max = INT_MAX,
+ .default_value = "1",
+ .description = "Time interval induced artificially before "
+ "post-operation phase of the transaction to "
+ "enhance overlap of adjacent write operations.",
+ },
{ .key = {NULL} },
};