summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2015-04-29 15:35:56 -0400
committerRaghavendra G <rgowdapp@redhat.com>2015-05-05 09:46:19 -0700
commit8965ac78bfd26e7f45c9579894191817afafa15e (patch)
treee06840aaaa2a9f0383bfb2108bfdf8f3c174d1e3
parentdbaaacf720baedc7f94b3acb6a479db394f54f57 (diff)
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 <dlambrig@redhat.com> Signed-off-by: root <root@gprfs018.sbu.lab.eng.bos.redhat.com> Signed-off-by: Dan Lambright <dlambrig@redhat.com> Reviewed-on: http://review.gluster.org/10324 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-helper.c22
1 files changed, 22 insertions, 0 deletions
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) */