summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShyamsundar Ranganathan <srangana@redhat.com>2017-06-26 16:26:11 +0000
committerRaghavendra Talur <rtalur@redhat.com>2017-07-04 14:39:29 +0000
commit5d21aaf97618f6e220fc0c028eba6b14c7439499 (patch)
tree02e4142cc4fcf0f8ec64c0bfc34e28749ba36d99
parentb8cdcca098728c5c12cc37606c8837a9b7a13c2f (diff)
Revert "Revert "glusterd: disallow rebalance & remove-brick on a sharded volume""
This is being reverted as a new bug around rebalance has been uncovered. As a result we would like to retain the warning in the code and in the release-notes. The new bug being, https://bugzilla.redhat.com/show_bug.cgi?id=1465075 A similar revert is being tracked for 3.11 here, https://review.gluster.org/17631 based on votes to both, we may want to consider this for 3.10 as well. This reverts commit abaf577626650edb4b9dfdddd43ba04a2a8e8ef3. BUG: 1467010 Change-Id: Iecd0357c44e41e2b421222e8f98fe8300513f963 Reviewed-on: https://review.gluster.org/17632 Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Tested-by: Raghavendra Talur <rtalur@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c9
2 files changed, 19 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 1fc28b2da55..5bb347cd6d8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -2180,6 +2180,16 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr)
case GF_OP_CMD_START:
{
+ if (dict_get_str_boolean (volinfo->dict, "features.shard",
+ _gf_false)) {
+ ret = -1;
+ snprintf (msg, sizeof (msg), "remove-brick operation is"
+ " not allowed on a sharded volume as it may"
+ " lead to a data loss situation.");
+ errstr = gf_strdup (msg);
+ goto out;
+ }
+
if ((volinfo->type == GF_CLUSTER_TYPE_REPLICATE) &&
dict_get (dict, "replica-count")) {
snprintf (msg, sizeof(msg), "Migration of data is not "
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index e293de22e58..2b43e181ccb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -691,6 +691,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)) {