summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-handshake.c
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2014-10-16 11:28:33 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-01-06 01:43:45 -0800
commit7efd84b1b743d3a91e23fd97dbf8a1d89b0d1f44 (patch)
treee7fdca416870f9a9471131cd5941fb4118d7eb20 /xlators/protocol/client/src/client-handshake.c
parentbb1601b94039b27b5a148479b61895a100ce8e6d (diff)
rdma: client connection establishment takes more time
Backport of http://review.gluster.org/8934 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: I82a8a27f0e65a2e287f321e5e8292d86c6baf5b4 BUG: 1166515 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/8934 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/9177 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client-handshake.c')
-rw-r--r--xlators/protocol/client/src/client-handshake.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index 8bd3d6a3d09..42b7ac0745e 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -1205,8 +1205,6 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
conf->connecting = 0;
conf->connected = 1;
- conf->need_different_port = 0;
-
if (lk_ver != client_get_lk_ver (conf)) {
gf_log (this->name, GF_LOG_INFO, "Server and Client "
"lk-version numbers are not same, reopening the fds");
@@ -1546,22 +1544,11 @@ client_query_portmap (xlator_t *this, struct rpc_clnt *rpc)
req.brick = remote_subvol;
- /* FIXME: Dirty work around */
if (!dict_get_str (options, "transport-type", &xprt)) {
- /* This logic is required only in case of 'rdma' client
- transport-type and the volume is of 'tcp,rdma'
- transport type. */
if (!strcmp (xprt, "rdma")) {
- if (!conf->need_different_port) {
- snprintf (brick_name, PATH_MAX, "%s.rdma",
- remote_subvol);
- req.brick = brick_name;
- conf->need_different_port = 1;
- conf->skip_notify = 1;
- } else {
- conf->need_different_port = 0;
- conf->skip_notify = 0;
- }
+ snprintf (brick_name, sizeof(brick_name), "%s.rdma",
+ remote_subvol);
+ req.brick = brick_name;
}
}