From e9023083b3a165390a8cc8fc77253f354744e81a Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Mon, 7 Nov 2016 16:06:56 +0530 Subject: features/shard: Fill loc.pargfid too for named lookups on individual shards 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: I5f85b303ede135baaf92e87ec8e09941f5ded6c1 BUG: 1392445 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/15788 CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Ravishankar N Reviewed-by: Pranith Kumar Karampuri Smoke: Gluster Build System --- libglusterfs/src/xlator.c | 17 +++++++++++++++++ libglusterfs/src/xlator.h | 1 + 2 files changed, 18 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 2221332a092..3c1cde50fa0 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 555916d2adb..70e6f0a108d 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -1011,6 +1011,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); -- cgit