summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-layout.c
diff options
context:
space:
mode:
authorshishir gowda <sgowda@redhat.com>2013-07-31 14:45:03 +0530
committerVijay Bellur <vbellur@redhat.com>2013-09-24 23:48:04 -0700
commit83937d1666f1f5e395afc7b2df477e9aad4c2278 (patch)
tree6e3b188667a014ed040891d518390da55c8b930e /xlators/cluster/dht/src/dht-layout.c
parentaa971f439d6eef9e52091915ce7ab1127aac1368 (diff)
Revert "cluster/dht: Return success in dht_discover if layout issues"
This reverts commit a3e593f9f17cb1e68db97bb5a0d8074793a33964 which was bought into fix dht_layout_anomalies error handling. We still see applications error'ing out due to graph switches. To fix the above issue - We cannot heal in dht_discover, as it is a gfid based lookup, and not path based. So, returning error here would lead to app's to see failure. Also, update the layout in inode_ctx even if it has anomalies. Let subsequent heals fix the issue. Conflicts: xlators/cluster/dht/src/dht-common.c Signed-off-by: shishir gowda <sgowda@redhat.com> Change-Id: I68c1056c3587e04a02344548546ddd06034489c5 BUG: 960348 Reviewed-on: http://review.gluster.org/5443 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-layout.c')
-rw-r--r--xlators/cluster/dht/src/dht-layout.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c
index 23a6cb0aefd..38e9970a7a8 100644
--- a/xlators/cluster/dht/src/dht-layout.c
+++ b/xlators/cluster/dht/src/dht-layout.c
@@ -601,8 +601,7 @@ dht_layout_anomalies (xlator_t *this, loc_t *loc, dht_layout_t *layout,
int
-dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout,
- uint32_t *missing_p)
+dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout)
{
int ret = 0;
int i = 0;
@@ -614,7 +613,6 @@ dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout,
ret = dht_layout_sort (layout);
if (ret == -1) {
- /* defensive coding; this can't happen currently */
gf_log (this->name, GF_LOG_WARNING,
"sort failed?! how the ....");
goto out;
@@ -624,26 +622,23 @@ dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout,
&holes, &overlaps,
&missing, &down, &misc, NULL);
if (ret == -1) {
- /* defensive coding; this can't happen currently */
gf_log (this->name, GF_LOG_WARNING,
"error while finding anomalies in %s -- not good news",
loc->path);
goto out;
}
- ret = holes + overlaps;
- if (ret) {
+ if (holes || overlaps) {
if (missing == layout->cnt) {
gf_log (this->name, GF_LOG_DEBUG,
"directory %s looked up first time",
loc->path);
} else {
gf_log (this->name, GF_LOG_INFO,
- "found anomalies in %s. holes=%d overlaps=%d"
- " missing=%d down=%d misc=%d",
- loc->path, holes, overlaps, missing, down,
- misc);
+ "found anomalies in %s. holes=%d overlaps=%d",
+ loc->path, holes, overlaps);
}
+ ret = -1;
}
for (i = 0; i < layout->cnt; i++) {
@@ -658,14 +653,14 @@ dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout,
(layout->list[i].xlator ?
layout->list[i].xlator->name
: "<>"));
+ if ((layout->list[i].err == ENOENT) && (ret >= 0)) {
+ ret++;
+ }
}
}
out:
- if (missing_p) {
- *missing_p = missing;
- }
return ret;
}