diff options
author | Kaushal M <kaushal@gluster.com> | 2011-09-26 11:19:24 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-09-27 05:37:36 -0700 |
commit | 0286dd866a89c035073294c348a43beca3109c38 (patch) | |
tree | 14de88eaa7580a029f12bba509b3facf66a2bd0a /xlators | |
parent | 68ff38bd2f77c62cd0c5729b047003694a7d63af (diff) |
glusterd: more checks before starting rebalance
Checks if specified volume is of a distribute type and has more than one
brick before attempting to start rebalance.
Change-Id: I9a3405019e7af4a7d7e162b0dc054bf9a99364e7
BUG: 3561
Reviewed-on: http://review.gluster.com/501
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rebalance.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index d2ad2ce9056..ed87a5bb72b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -608,6 +608,14 @@ glusterd_rebalance_cmd_validate (int cmd, char *volname, volname); goto out; } + if ((*volinfo)->brick_count <= (*volinfo)->dist_leaf_count) { + gf_log ("glusterd", GF_LOG_ERROR, "Volume %s is not a " + "distribute type or contains only 1 brick", volname); + snprintf (op_errstr, len, "Volume %s is not a distribute " + "volume or contains only 1 brick.\n" + "Not performing rebalance", volname); + goto out; + } if ((*volinfo)->status != GLUSTERD_STATUS_STARTED) { gf_log ("glusterd", GF_LOG_ERROR, "Received rebalance on stopped" |