diff options
| author | Amar Tumballi <amarts@redhat.com> | 2012-04-23 16:44:25 +0530 | 
|---|---|---|
| committer | Anand Avati <avati@redhat.com> | 2012-06-01 16:50:24 -0700 | 
| commit | 6aa52274afb95c0c79df23d8a2093fbd557935d2 (patch) | |
| tree | 090bfeb349e2522304acd45562c6ca0a3940d0a3 | |
| parent | 2084c0e3d748b7e28d2fc9749ad9d1e2bf63208c (diff) | |
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 <amarts@redhat.com>
BUG: 815227
Reviewed-on: http://review.gluster.com/3213
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Reviewed-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 15 | 
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 25f81331cd4..515bff359bc 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;  | 
