diff options
author | Dan Lambright <dlambrig@redhat.com> | 2015-05-07 14:59:51 -0400 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-05-08 01:55:41 -0700 |
commit | eee703473f17e3784e15dba291cc3df00fde9f96 (patch) | |
tree | 6be0d1730697a17ab139c6472957d84b1f30c516 | |
parent | 268b7fcb307e14cce5bcd28495f24333710ba82c (diff) |
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 <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>
> Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Change-Id: Ia4acb0035ff1da15f6a8f9ed54f43c76e8b98f5f
BUG: 1219608
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/10654
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System
Reviewed-by: Joseph Fernandes
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | xlators/cluster/dht/src/dht-helper.c | 22 |
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) */ |