diff options
author | Dan Lambright <dlambrig@redhat.com> | 2015-04-13 02:42:12 +0100 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-04-22 07:51:03 -0700 |
commit | 86b02afab780e559e82399b9e96381d8df594ed6 (patch) | |
tree | e59242b087191dfb6af7b302b18a59206a9cd17c /cli/src/cli-rpc-ops.c | |
parent | abbc525dd3cbe142753c5b44a2717c1ed6b26723 (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 'cli/src/cli-rpc-ops.c')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 7c5743af741..e8a81cd6523 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -56,6 +56,10 @@ extern rpc_clnt_prog_t *cli_rpc_prog; extern int cli_op_ret; extern int connected; +int32_t +gf_cli_remove_brick (call_frame_t *frame, xlator_t *this, + void *data); + char *cli_vol_type_str[] = {"Distribute", "Stripe", "Replicate", @@ -1355,11 +1359,14 @@ gf_cli_print_rebalance_status (dict_t *dict, enum gf_task_types task_type) /* Check if status is NOT_STARTED, and continue early */ memset (key, 0, 256); snprintf (key, 256, "status-%d", i); + ret = dict_get_int32 (dict, key, (int32_t *)&status_rcd); if (ret) { + gf_log ("cli", GF_LOG_TRACE, "count %d %d", count, i); gf_log ("cli", GF_LOG_TRACE, "failed to get status"); goto out; } + if (GF_DEFRAG_STATUS_NOT_STARTED == status_rcd) continue; @@ -2245,6 +2252,7 @@ gf_cli_remove_brick_cbk (struct rpc_req *req, struct iovec *iov, } switch (cmd) { + case GF_OP_CMD_DETACH_START: case GF_OP_CMD_START: cmd_str = "start"; @@ -3913,30 +3921,7 @@ int32_t gf_cli_detach_tier (call_frame_t *frame, xlator_t *this, void *data) { - gf_cli_req req = {{0,} }; - int ret = 0; - dict_t *dict = NULL; - char *volname = NULL; - - if (!frame || !this || !data) { - ret = -1; - goto out; - } - - dict = data; - - ret = cli_to_glusterd (&req, frame, gf_cli_remove_brick_cbk, - (xdrproc_t) xdr_gf_cli_req, dict, - GLUSTER_CLI_DETACH_TIER, this, - cli_rpc_prog, NULL); - - -out: - gf_log ("cli", GF_LOG_DEBUG, "Returning %d", ret); - - GF_FREE (req.dict.dict_val); - - return ret; + return gf_cli_remove_brick(frame, this, data); } |