summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/dht/src/dht-common.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c18
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c2
3 files changed, 21 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 092ddebb8f5..3a1a9422d46 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -6846,7 +6846,8 @@ dht_notify (xlator_t *this, int event, void *data, ...)
gf_defrag_status_get (defrag, output);
else if (cmd == GF_DEFRAG_CMD_START_DETACH_TIER)
gf_defrag_start_detach_tier(defrag);
- else if (cmd == GF_DEFRAG_CMD_STOP)
+ else if (cmd == GF_DEFRAG_CMD_STOP ||
+ cmd == GF_DEFRAG_CMD_STOP_DETACH_TIER)
gf_defrag_stop (defrag,
GF_DEFRAG_STATUS_STOPPED, output);
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index f2e7d3a9d3e..0af86f56854 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -1659,6 +1659,14 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr)
goto out;
case GF_OP_CMD_DETACH_START:
+ if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
+ snprintf (msg, sizeof(msg), "volume %s is not a tier "
+ "volume", volinfo->volname);
+ errstr = gf_strdup (msg);
+ gf_log (this->name, GF_LOG_ERROR, "%s", errstr);
+ goto out;
+ }
+
case GF_OP_CMD_START:
{
if ((volinfo->type == GF_CLUSTER_TYPE_REPLICATE) &&
@@ -1742,8 +1750,16 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr)
ret = 0;
break;
- case GF_OP_CMD_COMMIT:
case GF_OP_CMD_DETACH_COMMIT:
+ if (volinfo->type != GF_CLUSTER_TYPE_TIER) {
+ snprintf (msg, sizeof(msg), "volume %s is not a tier "
+ "volume", volinfo->volname);
+ errstr = gf_strdup (msg);
+ gf_log (this->name, GF_LOG_ERROR, "%s", errstr);
+ goto out;
+ }
+
+ case GF_OP_CMD_COMMIT:
if (volinfo->decommission_in_progress) {
errstr = gf_strdup ("use 'force' option as migration "
"is in progress");
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index f126e8f0b1f..ac5f139c0b2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -658,6 +658,7 @@ glusterd_op_stage_rebalance (dict_t *dict, char **op_errstr)
break;
case GF_DEFRAG_CMD_STATUS:
case GF_DEFRAG_CMD_STOP:
+ case GF_DEFRAG_CMD_STOP_DETACH_TIER:
ret = dict_get_str (dict, "cmd-str", &cmd_str);
if (ret) {
gf_log (this->name, GF_LOG_ERROR, "Failed to get "
@@ -822,6 +823,7 @@ glusterd_op_rebalance (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
cmd, NULL, GD_OP_REBALANCE);
break;
case GF_DEFRAG_CMD_STOP:
+ case GF_DEFRAG_CMD_STOP_DETACH_TIER:
/* Clear task-id only on explicitly stopping rebalance.
* Also clear the stored operation, so it doesn't cause trouble
* with future rebalance/remove-brick starts