summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-11-07 16:06:56 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-11-08 22:39:14 -0800
commitc5d2002ac2e68dc8aa7d54a32e9bd441b9b8bcfa (patch)
treeb29316a472ea24a0ea23dfb3eb364ba9e04c608f
parent7168e27c23079734934976a59bc2ee31bbed31a5 (diff)
features/shard: Fill loc.pargfid too for named lookups on individual shards
Backport of: http://review.gluster.org/#/c/15788/ On a sharded volume when a brick is replaced while IO is going on, named lookup on individual shards as part of read/write was failing with ENOENT on the replaced brick, and as a result AFR initiated name heal in lookup callback. But since pargfid was empty (which is what this patch attempts to fix), the resolution of the shards by protocol/server used to fail and the following pattern of logs was seen: Brick-logs: [2016-11-08 07:41:49.387127] W [MSGID: 115009] [server-resolve.c:566:server_resolve] 0-rep-server: no resolution type for (null) (LOOKUP) [2016-11-08 07:41:49.387157] E [MSGID: 115050] [server-rpc-fops.c:156:server_lookup_cbk] 0-rep-server: 91833: LOOKUP(null) (00000000-0000-0000-0000-000000000000/16d47463-ece5-4b33-9c93-470be918c0f6.82) ==> (Invalid argument) [Invalid argument] Client-logs: [2016-11-08 07:41:27.497687] W [MSGID: 114031] [client-rpc-fops.c:2930:client3_3_lookup_cbk] 2-rep-client-0: remote operation failed. Path: (null) (00000000-0000-0000-0000-000000000000) [Invalid argument] [2016-11-08 07:41:27.497755] W [MSGID: 114031] [client-rpc-fops.c:2930:client3_3_lookup_cbk] 2-rep-client-1: remote operation failed. Path: (null) (00000000-0000-0000-0000-000000000000) [Invalid argument] [2016-11-08 07:41:27.498500] W [MSGID: 114031] [client-rpc-fops.c:2930:client3_3_lookup_cbk] 2-rep-client-2: remote operation failed. Path: (null) (00000000-0000-0000-0000-000000000000) [Invalid argument] [2016-11-08 07:41:27.499680] E [MSGID: 133010] Also, this patch makes AFR by itself choose a non-NULL pargfid even if its ancestors fail to initialize all pargfid placeholders. Change-Id: I34b9f90d0f09766b6d87b3994d5cd7a77b622dcb BUG: 1392853 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/15797 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--libglusterfs/src/xlator.c17
-rw-r--r--libglusterfs/src/xlator.h1
-rw-r--r--xlators/cluster/afr/src/afr-common.c6
-rw-r--r--xlators/features/shard/src/shard.c1
4 files changed, 23 insertions, 2 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index 22a494d..5c91380 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -762,6 +762,23 @@ out:
return;
}
+void
+loc_pargfid (loc_t *loc, uuid_t gfid)
+{
+ if (!gfid)
+ goto out;
+ gf_uuid_clear (gfid);
+
+ if (!loc)
+ goto out;
+ else if (!gf_uuid_is_null (loc->pargfid))
+ gf_uuid_copy (gfid, loc->pargfid);
+ else if (loc->parent && (!gf_uuid_is_null (loc->parent->gfid)))
+ gf_uuid_copy (gfid, loc->parent->gfid);
+out:
+ return;
+}
+
char*
loc_gfid_utoa (loc_t *loc)
{
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index ca30f99..61d904f 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -963,6 +963,7 @@ int loc_copy_overload_parent (loc_t *dst,
void loc_wipe (loc_t *loc);
int loc_path (loc_t *loc, const char *bname);
void loc_gfid (loc_t *loc, uuid_t gfid);
+void loc_pargfid (loc_t *loc, uuid_t pargfid);
char* loc_gfid_utoa (loc_t *loc);
gf_boolean_t loc_is_root (loc_t *loc);
int32_t loc_build_child (loc_t *child, loc_t *parent, char *name);
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 24366d1..923afc8 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -2235,12 +2235,14 @@ afr_lookup_selfheal_wrap (void *opaque)
afr_local_t *local = NULL;
xlator_t *this = NULL;
inode_t *inode = NULL;
+ uuid_t pargfid = {0,};
local = frame->local;
this = frame->this;
+ loc_pargfid (&local->loc, pargfid);
- ret = afr_selfheal_name (frame->this, local->loc.pargfid,
- local->loc.name, &local->cont.lookup.gfid_req);
+ ret = afr_selfheal_name (frame->this, pargfid, local->loc.name,
+ &local->cont.lookup.gfid_req);
if (ret == -EIO)
goto unwind;
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index b8dc5bb..2a06f5b 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -1678,6 +1678,7 @@ shard_common_lookup_shards (call_frame_t *frame, xlator_t *this, inode_t *inode,
bname = strrchr (path, '/') + 1;
loc.inode = inode_new (this->itable);
loc.parent = inode_ref (priv->dot_shard_inode);
+ gf_uuid_copy (loc.pargfid, priv->dot_shard_gfid);
ret = inode_path (loc.parent, bname, (char **) &(loc.path));
if (ret < 0 || !(loc.inode)) {
gf_msg (this->name, GF_LOG_ERROR, 0,