summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishna Srinivas <krishna@zresearch.com>2009-02-24 06:55:39 -0800
committerAnand V. Avati <avati@amp.gluster.com>2009-02-25 16:48:45 +0530
commit6609b1d37bd0254ec0eb068758862a0bb0e78515 (patch)
tree4cb7df321224329a56c7f13c6bc7275beb20e2fd
parent1d556afdf8bf5459a1ea1a27ed5638d440439666 (diff)
DHT selfheal fix during lookup - create missing directories.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r--xlators/cluster/dht/src/dht-layout.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c
index 08b4a2746f8..1ec2e6c2edc 100644
--- a/xlators/cluster/dht/src/dht-layout.c
+++ b/xlators/cluster/dht/src/dht-layout.c
@@ -425,6 +425,7 @@ int
dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout)
{
int ret = 0;
+ int i = 0;
uint32_t holes = 0;
uint32_t overlaps = 0;
uint32_t missing = 0;
@@ -462,6 +463,19 @@ dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout)
ret = 1;
}
+ for (i = 0; i < layout->cnt; i++) {
+ /* TODO During DHT selfheal rewrite (almost) find a better place to
+ * detect this - probably in dht_layout_anomalies()
+ */
+ if (layout->list[i].err == ENOENT) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "path=%s ENOENT - directory entry"
+ " should be created in selfheal", loc->path);
+ ret = 1;
+ break;
+ }
+ }
+
out:
return ret;
}