summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2012-08-21 10:55:37 +0200
committerVijay Bellur <vbellur@redhat.com>2012-10-25 02:09:24 -0700
commit251a0056e35ea5d4c1ef4d5eede15e67c7428469 (patch)
treee2de4fd197dd6545794050ce441b3955dba7ee96
parentc2475b94ea0403efff117c70bf6eb70afd31ed3c (diff)
glusterd-volgen: by default include 'cluster/distribute' in volfile
This is a backport of Ie9d559e6b26aafd3d67908ab20a006e4e5e70d73 We need it in order to avoid spurious EINVAL when scaling from 1 brick to more in distributed volumes. BUG: 815227 Change-Id: I9858af03bf6d7724ff997f341faca62e89aecfb0 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/3838 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 5b16c97c1..d6bb77e21 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -2369,7 +2369,6 @@ volgen_graph_build_dht_cluster (volgen_graph_t *graph,
char *decommissioned_children = NULL;
xlator_t *dht = NULL;
- GF_ASSERT (child_count > 1);
clusters = volgen_graph_build_clusters (graph, volinfo,
"cluster/distribute", "%s-dht",
child_count, child_count);
@@ -2462,12 +2461,16 @@ volume_volgen_graph_build_clusters (volgen_graph_t *graph,
build_distribute:
dist_count = volinfo->brick_count / volinfo->dist_leaf_count;
- if (dist_count > 1) {
- ret = volgen_graph_build_dht_cluster (graph, volinfo,
- dist_count);
- if (ret)
- goto out;
+ if (!dist_count) {
+ ret = -1;
+ goto out;
}
+
+ ret = volgen_graph_build_dht_cluster (graph, volinfo,
+ dist_count);
+ if (ret)
+ goto out;
+
ret = 0;
out:
return ret;