summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-syncop.c
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2015-04-13 02:42:12 +0100
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-04-22 07:51:03 -0700
commit86b02afab780e559e82399b9e96381d8df594ed6 (patch)
treee59242b087191dfb6af7b302b18a59206a9cd17c /xlators/mgmt/glusterd/src/glusterd-syncop.c
parentabbc525dd3cbe142753c5b44a2717c1ed6b26723 (diff)
glusterd: support for tier volumes 'detach start' and 'detach commit'
These commands work in a manner analagous to rebalancing when removing a brick. The existing migration daemon detects "detach start" and switches to moving data off the hot tier. While in this state all lookups are directed to the cold tier. gluster v detach-tier <vol> start gluster v detach-tier <vol> commit The status and stop cli commands shall be submitted separately. Change-Id: I24fda5cc3ba74f5fb8aa9a3234ad51f18b80a8a0 BUG: 1205540 Signed-off-by: Dan Lambright <dlambrig@redhat.com> Signed-off-by: root <root@localhost.localdomain> Signed-off-by: Dan Lambright <dlambrig@redhat.com> Reviewed-on: http://review.gluster.org/10108 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: NetBSD Build System
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
index c5066b015a3..663b0a73875 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
@@ -1542,6 +1542,7 @@ gd_brick_op_phase (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
rpc_clnt_t *rpc = NULL;
dict_t *rsp_dict = NULL;
glusterd_conf_t *conf = NULL;
+ int32_t cmd = GF_OP_CMD_NONE;
this = THIS;
conf = this->private;
@@ -1585,8 +1586,24 @@ gd_brick_op_phase (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict,
"due to rpc failure.");
goto out;
}
+
+ /* Redirect operation to be detach tier via rebalance flow. */
+ ret = dict_get_int32 (req_dict, "command", &cmd);
+ if (!ret) {
+ if (cmd == GF_OP_CMD_DETACH_START) {
+ op = GD_OP_REBALANCE;
+ ret = dict_set_int32 (req_dict, "rebalance-command",
+ GF_DEFRAG_CMD_START_DETACH_TIER);
+ if (ret)
+ goto out;
+ }
+ }
ret = gd_syncop_mgmt_brick_op (rpc, pending_node, op, req_dict,
op_ctx, op_errstr);
+ if (cmd == GF_OP_CMD_DETACH_START) {
+ op = GD_OP_REMOVE_BRICK;
+ dict_del (req_dict, "rebalance-command");
+ }
if (ret)
goto out;