From 6aa52274afb95c0c79df23d8a2093fbd557935d2 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 23 Apr 2012 16:44:25 +0530 Subject: glusterd-volgen: by default include 'cluster/distribute' in volfile include 'cluster/distribute' even if there is just one brick in the volume, that way, the directories would have some of the required extended attributes on it before a 'add-brick'. this fixes the issues of applications getting errored out when a 'add-brick' is done when a volume had only one brick before. Change-Id: Ie9d559e6b26aafd3d67908ab20a006e4e5e70d73 Signed-off-by: Amar Tumballi BUG: 815227 Reviewed-on: http://review.gluster.com/3213 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Shishir Gowda Reviewed-by: Raghavendra G Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 25f81331c..515bff359 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -2363,7 +2363,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); @@ -2456,12 +2455,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; -- cgit