From 85e92d160bd71fdaeb3ae89d3440eec8fd438da9 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Thu, 16 Oct 2014 11:28:33 +0530 Subject: rdma: client connection establishment takes more time For rdma type only volume client connection establishment with server takes more than three seconds. Because for tcp,rdma type volume, will have 2 ports one for tcp and one for rdma, tcp port is stored with brickname and rdma port is stored as "brickname.rdma" during pamap_sighin. During the handshake when trying to get the brick port for rdma clients, since we are not aware of server transport type, we will append '.rdma' with brick name. So for tcp,rdma volume there will be an entry with '.rdma', but it will fail for rdma type only volume. So we will try again, this time without appending '.rdma' using a flag variable need_different_port, and it will succeed, but the reconnection happens only after 3 seconds. In this patch for rdma only type volume we will append '.rdma' during the pmap_signin. So during the handshake we will get the correct port for first try itself. Since we don't need to retry , we can remove the need_different_port flag variable. Change-Id: Ie8e3a7f532d4104829dbe995e99b35e95571466c BUG: 1153569 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/8934 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Reviewed-by: Raghavendra G Tested-by: Raghavendra G --- glusterfsd/src/glusterfsd-mgmt.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 9addd77cb2..3ff3337c01 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -2160,10 +2160,11 @@ out: int glusterfs_mgmt_pmap_signin (glusterfs_ctx_t *ctx) { - call_frame_t *frame = NULL; - pmap_signin_req req = {0, }; - int ret = -1; - cmd_args_t *cmd_args = NULL; + call_frame_t *frame = NULL; + pmap_signin_req req = {0, }; + int ret = -1; + cmd_args_t *cmd_args = NULL; + char brick_name[PATH_MAX] = {0,}; frame = create_frame (THIS, ctx->pool); cmd_args = &ctx->cmd_args; @@ -2174,8 +2175,15 @@ glusterfs_mgmt_pmap_signin (glusterfs_ctx_t *ctx) goto out; } + if (cmd_args->volfile_server_transport && + !strcmp(cmd_args->volfile_server_transport, "rdma")) { + snprintf (brick_name, sizeof(brick_name), "%s.rdma", + cmd_args->brick_name); + req.brick = brick_name; + } else + req.brick = cmd_args->brick_name; + req.port = cmd_args->brick_port; - req.brick = cmd_args->brick_name; ret = mgmt_submit_request (&req, frame, ctx, &clnt_pmap_prog, GF_PMAP_SIGNIN, mgmt_pmap_signin_cbk, @@ -2226,6 +2234,7 @@ glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx) pmap_signout_req req = {0, }; call_frame_t *frame = NULL; cmd_args_t *cmd_args = NULL; + char brick_name[PATH_MAX] = {0,}; frame = create_frame (THIS, ctx->pool); cmd_args = &ctx->cmd_args; @@ -2236,8 +2245,15 @@ glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx) goto out; } + if (cmd_args->volfile_server_transport && + !strcmp(cmd_args->volfile_server_transport, "rdma")) { + snprintf (brick_name, sizeof(brick_name), "%s.rdma", + cmd_args->brick_name); + req.brick = brick_name; + } else + req.brick = cmd_args->brick_name; + req.port = cmd_args->brick_port; - req.brick = cmd_args->brick_name; req.rdma_port = cmd_args->brick_port2; ret = mgmt_submit_request (&req, frame, ctx, &clnt_pmap_prog, GF_PMAP_SIGNOUT, mgmt_pmap_signout_cbk, -- cgit