summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-syncop.c
diff options
context:
space:
mode:
authorSamikshan Bairagya <samikshan@gmail.com>2017-06-02 10:12:12 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-07-10 04:33:19 +0000
commit9e8ee31e643b7fbf7d46092c395ea27aaeb82f6b (patch)
treec48e28158aa31462bba580a8ef38e01ce1a5af6d /xlators/mgmt/glusterd/src/glusterd-syncop.c
parente304f48fa262e5cdbe181fb3fee5dfb9c893108c (diff)
glusterd: Introduce option to limit no. of muxed bricks per process
This commit introduces a new global option that can be set to limit the number of multiplexed bricks in one process. Usage: `# gluster volume set all cluster.max-bricks-per-process <value>` If this option is not set then multiplexing will happen for now with no limitations set; i.e. a brick process will have as many bricks multiplexed to it as possible. In other words the current multiplexing behaviour won't change if this option isn't set to any value. This commit also introduces a brick process instance that contains information about brick processes, like the number of bricks handled by the process (which is 1 in non-multiplexing cases), list of bricks, and port number which also serves as an unique identifier for each brick process instance. The brick process list is maintained in 'glusterd_conf_t'. Updates: #151 Change-Id: Ib987d14ab0a4f6034dac01b73a4b2839f7b0b695 Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: https://review.gluster.org/17469 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
index e5fba968c07..913b5946b6e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
@@ -957,6 +957,7 @@ gd_syncop_mgmt_brick_op (struct rpc_clnt *rpc, glusterd_pending_node_t *pnode,
gd1_mgmt_brick_op_req *req = NULL;
int ret = 0;
xlator_t *this = NULL;
+ glusterd_brickinfo_t *brickinfo = NULL;
this = THIS;
args.op_ret = -1;
@@ -986,6 +987,23 @@ gd_syncop_mgmt_brick_op (struct rpc_clnt *rpc, glusterd_pending_node_t *pnode,
GF_FREE (args.errstr);
}
+ if (op == GD_OP_STOP_VOLUME || op == GD_OP_REMOVE_BRICK) {
+ if (args.op_ret == 0) {
+ brickinfo = pnode->node;
+ ret = glusterd_brick_process_remove_brick (brickinfo);
+ if (ret) {
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
+ GD_MSG_BRICKPROC_REM_BRICK_FAILED,
+ "Removing brick %s:%s from brick"
+ " process failed",
+ brickinfo->hostname,
+ brickinfo->path);
+ args.op_ret = ret;
+ goto out;
+ }
+ }
+ }
+
if (GD_OP_STATUS_VOLUME == op) {
ret = dict_set_int32 (args.dict, "index", pnode->index);
if (ret) {
@@ -1023,7 +1041,6 @@ out:
dict_unref (args.dict);
gd_brick_op_req_free (req);
return args.op_ret;
-
}
int32_t