summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rebalance.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rebalance.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 60d39cbd774..22c18b96033 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -695,6 +695,15 @@ glusterd_op_stage_rebalance (dict_t *dict, char **op_errstr)
volname);
goto out;
}
+ if (dict_get_str_boolean (volinfo->dict, "features.shard",
+ _gf_false)) {
+ ret = -1;
+ snprintf (msg, sizeof (msg), "rebalance operation is not"
+ " allowed on a sharded volume as it may lead"
+ " to a data loss situation. Use start force "
+ " option to bypass this validation");
+ goto out;
+ }
case GF_DEFRAG_CMD_START_FORCE:
if (is_origin_glusterd (dict)) {