diff options
author | Krishnan Parthasarathi <kp@gluster.com> | 2012-01-04 19:05:18 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-01-04 11:32:01 -0800 |
commit | 0a4ac033095c0675c90abc353736f388873291c0 (patch) | |
tree | b9d393a9f1c6c9876a9a9fd62e502235c5037965 /xlators/mgmt/glusterd/src/glusterd-brick-ops.c | |
parent | 60862f5916dff99c91dd6d6319c958d02cb535d8 (diff) |
glusterd: Added checks for remove-brick handler.
Removing bricks in a plain stripe-replicate is failed
if replica count is not reduced explicitly.
Change-Id: I6d0de4862595744d1d1998b9a287c34c53d7fe5f
BUG: 770561
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/2577
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 6d746ef912d..c7e9b56bc81 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -643,6 +643,17 @@ glusterd_handle_remove_brick (rpcsvc_request_t *req) } } + if (!replica_count && + (volinfo->type == GF_CLUSTER_TYPE_STRIPE_REPLICATE) && + (volinfo->brick_count == volinfo->dist_leaf_count)) { + snprintf (err_str, 2048, "Removing bricks from stripe-replicate" + " configuration is not allowed without reducing " + "replica or stripe count explicitly."); + gf_log (THIS->name, GF_LOG_ERROR, "%s", err_str); + ret = -1; + goto out; + } + brick_list = GF_MALLOC (120000 * sizeof(*brick_list),gf_common_mt_char); if (!brick_list) { |