diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2010-07-27 06:16:53 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-28 02:24:49 -0700 |
commit | 7ced5bf710bbbee3290845b7ee65b5c895c06e7d (patch) | |
tree | d72b5b844262838bb2190aa91efc4b96b22502d3 /xlators/cluster/afr/src/afr-inode-write.c | |
parent | 045efc1f5d59d98fff28ea29039ead4015fe1e6b (diff) |
replicate: Set setxattr wait-count to child-count to avoid race
A race is seen during a compilebench load against NFS where a NFSv3 MKDIR is
immediately followed by a LOOKUP on the new directory. By the time this lookup
comes in, the setxattr issued by distribute for the mkdir has not returned yet
from all the replicas. Since replicate returns a reply for setxattr after
receiving reply only from one subvol, the MKDIR is unwound from distribute.
When the LOOKUP is received at distribute, the setxattr has still not completed
at the second replica, whereas that is where the lookup is sent by replicate.
Finding that the xattr is missing from the dir, distribute returns ESTALE to
NFS, which return NFS3ERR_STALE to nfs client.
This patch changes replicate setxattr behaviour by forcing replicate to wait for all
children rather than one to call back before unwinding the stack.
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 937 (compilebench fails on NFS+dist+repl+all perf xlators)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=937
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-inode-write.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c index 37909181e21..eff01da8610 100644 --- a/xlators/cluster/afr/src/afr-inode-write.c +++ b/xlators/cluster/afr/src/afr-inode-write.c @@ -1296,7 +1296,7 @@ afr_setxattr_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } local->success_count++; - if (local->success_count == priv->wait_count) { + if (local->success_count == priv->child_count) { need_unwind = 1; } } |