summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2015-04-28 16:26:33 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-05-05 08:36:26 -0700
commit377505a101eede8943f5a345e11a6901c4f8f420 (patch)
tree8eb72273b2b07e72368c5a44ff026db8c2c343dc /xlators/cluster/dht/src
parenta197943463d3913707de56e3a1a9ef68bba5901f (diff)
cluster/tier: don't use hot tier until subvolumes ready
When we attach a tier, the hot tier becomes the hashed subvolume. But directories may not yet have been replicated by the fix layout process. Hence lookups to those directories will fail on the hot subvolume. We should only go to the hashed subvolume once the layout has been fixed. This is known if the layout for the parent directory does not have an error. If there is an error, the cold tier is considered the hashed subvolume. The exception to this rules is ENOCON, in which case we do not know where the file is and must abort. Note we may revalidate a lookup for a directory even if the inode has not yet been populated by FUSE. This case can happen in tiering (where one tier has completed a lookup but the other has not, in which case we revalidate one tier when we call lookup the second time). Such inodes are still invalid and should not be consulted for validation. Change-Id: Ia2bc62e1d807bd70590bd2a8300496264d73c523 BUG: 1214289 Signed-off-by: Dan Lambright <dlambrig@redhat.com> Reviewed-on: http://review.gluster.org/10435 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: N Balachandran <nbalacha@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src')
-rw-r--r--xlators/cluster/dht/src/dht-common.c4
-rw-r--r--xlators/cluster/dht/src/tier.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index c26100c84fa..6c0afdbec90 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -715,7 +715,8 @@ dht_revalidate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto unlock;
}
- if (stbuf->ia_type != local->inode->ia_type) {
+ if ((!IA_ISINVAL(local->inode->ia_type)) &&
+ stbuf->ia_type != local->inode->ia_type) {
gf_msg (this->name, GF_LOG_WARNING, 0,
DHT_MSG_FILE_TYPE_MISMATCH,
"mismatching filetypes 0%o v/s 0%o for %s,"
@@ -727,6 +728,7 @@ dht_revalidate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->op_errno = EINVAL;
goto unlock;
+
}
layout = local->layout;
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index 593a2cc29ed..866405105a8 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -973,6 +973,9 @@ tier_search (xlator_t *this, dht_layout_t *layout, const char *name)
search_first_subvol = 1;
}
+ if ((layout->list[0].err > 0) && (layout->list[0].err != ENOTCONN))
+ search_first_subvol = 0;
+
if (search_first_subvol)
subvol = layout->list[0].xlator;
else