summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-03-16 22:10:02 +0530
committerAnand Avati <avati@redhat.com>2012-03-18 00:30:19 -0700
commitf159e2247b58441449ad8da13ddf5cc5d3887b93 (patch)
tree315737be8c6742a8827aba537d0a903d06646903 /xlators/cluster/afr
parent7cc412c7a2d2e4a6c7709b84bed75c10e5476244 (diff)
cluster/afr: set_read_child when xactions in progress in fresh lookup
Change-Id: I33e0268635ae7a1f247b0052994e027f990083da BUG: 800755 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/2963 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-common.c9
-rw-r--r--xlators/cluster/afr/src/afr.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index fb694473db7..e220a61722d 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1673,9 +1673,11 @@ afr_lookup_done_success_action (call_frame_t *frame, xlator_t *this,
int32_t ret = -1;
afr_local_t *local = NULL;
afr_private_t *priv = NULL;
+ gf_boolean_t fresh_lookup = _gf_false;
local = frame->local;
priv = this->private;
+ fresh_lookup = local->cont.lookup.fresh_lookup;
if (local->loc.parent == NULL)
fail_conflict = _gf_true;
@@ -1689,9 +1691,9 @@ afr_lookup_done_success_action (call_frame_t *frame, xlator_t *this,
goto out;
}
- if (!afr_is_transaction_running (local)) {
- ret = afr_lookup_select_read_child (local, this, &read_child);
- if (ret)
+ ret = afr_lookup_select_read_child (local, this, &read_child);
+ if (!afr_is_transaction_running (local) || fresh_lookup) {
+ if (read_child < 0)
goto out;
ret = afr_lookup_set_read_ctx (local, this, read_child);
@@ -2027,6 +2029,7 @@ afr_lookup (call_frame_t *frame, xlator_t *this,
% (priv->child_count);
}
UNLOCK (&priv->read_child_lock);
+ local->cont.lookup.fresh_lookup = _gf_true;
}
local->child_up = memdup (priv->child_up,
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 80a76421296..09b1bf2a956 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -444,6 +444,7 @@ typedef struct _afr_local {
int32_t read_child;
int32_t *sources;
int32_t *success_children;
+ gf_boolean_t fresh_lookup;
} lookup;
struct {