diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-06-23 21:35:29 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2014-06-24 09:26:13 -0700 |
commit | 5d2603c75bfd78c8b33903a20e844430276e7539 (patch) | |
tree | 3ca00f09ca0835de64167674351c386190e0a25d /xlators/protocol/client | |
parent | b8f6798c173301f9fe0b12b53c67366fb8eaed59 (diff) |
cluster/afr: Fix resolution issues with afr
Problem with afr:
Lets say there is a directory hierarchy a/b/c/d on the mount and the
user is cd'ed into the directory. Bring down one of the bricks of replica and
remove all directories/files to simulate disk replacement on that brick. Now
this brick is brought back up. Creates on the cd'ed directory fail with ESTALE.
Basically before sending a create of 'f' inside 'd', fuse sends a lookup to
make sure the file is not present. On one of the bricks 'd' is present and
'f' is not so it sends ENOENT as response. On the new brick 'd' itself is not
present. So it sends ESTALE. In afr ESTALE is considered to be special errno on
witnessing which lookup has to fail. And ESTALE is given more priority than
ENOENT. Due to these reasons lookup fails with ESTALE rather than ENOENT. Since
lookup didn't fail with ENOENT, 'create' can't be issued so the command is
failed with ESTALE.
Solution:
Afr needs to consider ESTALE errno normally and ENOENT needs to
be given more priority so that operations like create can proceed even when
only one of the brick is up and running. Whenever client xlator identifies
that gfid-changed, it sets that information in lookup xdata. Afr uses this
information to fail the lookup with ESTALE so that top xlator can send
fresh lookup.
Change-Id: Ie8e0e327542fd644409eb5dadf451679afa1c0e5
BUG: 1112348
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8154
Tested-by: Justin Clift <justin@gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/protocol/client')
-rw-r--r-- | xlators/protocol/client/src/client-rpc-fops.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index 38bc7b6238f..3bd1206e4d0 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -2755,6 +2755,8 @@ client3_3_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count, "gfid changed for %s", local->loc.path); rsp.op_ret = -1; op_errno = ESTALE; + if (xdata) + ret = dict_set_int32 (xdata, "gfid-changed", 1); goto out; } |