From 8965ac78bfd26e7f45c9579894191817afafa15e Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Wed, 29 Apr 2015 15:35:56 -0400 Subject: guster/dht: tiered volumes may not allow access to files undergoing migration 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. 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 --- xlators/cluster/dht/src/dht-helper.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'xlators/cluster') 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