From eee703473f17e3784e15dba291cc3df00fde9f96 Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Thu, 7 May 2015 14:59:51 -0400 Subject: guster/dht: tiered volumes may not allow access to files undergoing migration This is a backport of fix 10324 to Gluster 3.7. If a read IO occurs against a file that has reached rebalance phase 2, we redirect the IO to the destination. For tiered volumes, when we try to reopen the file (on the destination), the lower level DHT receives the open call and fails; it does not have a "cached subvol". Fix is to "teach" the lower level DHT of the new location by sending a locate before the open. > http://review.gluster.org/#/c/10324/ > Change-Id: Ia4acb0035ff1da15f6a8f9ed54f43c76e8b98f5f > BUG: 1214048 > Signed-off-by: Dan Lambright > Signed-off-by: root > Signed-off-by: Dan Lambright > Reviewed-on: http://review.gluster.org/10324 > Tested-by: NetBSD Build System > Tested-by: Gluster Build System > Reviewed-by: Raghavendra G > Tested-by: Raghavendra G > Signed-off-by: Dan Lambright Change-Id: Ia4acb0035ff1da15f6a8f9ed54f43c76e8b98f5f BUG: 1219608 Signed-off-by: Dan Lambright Reviewed-on: http://review.gluster.org/10654 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Joseph Fernandes Reviewed-by: Vijay Bellur --- xlators/cluster/dht/src/dht-helper.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index b5114b620ce..312717198b1 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -946,6 +946,28 @@ dht_migration_complete_check_task (void *data) local->op_errno = EIO; goto out; } + } else { + tmp_loc.inode = inode; + gf_uuid_copy (tmp_loc.gfid, inode->gfid); + ret = syncop_lookup (dst_node, &tmp_loc, &stbuf, 0, 0, 0); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "%s: failed to lookup the file on %s", + tmp_loc.path, dst_node->name); + local->op_errno = -ret; + ret = -1; + goto out; + } + + if (gf_uuid_compare (stbuf.ia_gfid, tmp_loc.inode->gfid)) { + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_GFID_MISMATCH, + "%s: gfid different on the target file on %s", + tmp_loc.path, dst_node->name); + ret = -1; + local->op_errno = EIO; + goto out; + } } /* update inode ctx (the layout) */ -- cgit