diff options
| author | Amar Tumballi <amar@gluster.com> | 2011-06-17 06:10:53 +0000 |
|---|---|---|
| committer | Anand Avati <avati@gluster.com> | 2011-06-19 02:16:34 -0700 |
| commit | a6fd403a15ffead93daba8a737cd7c6d6a943744 (patch) | |
| tree | 618fd1c03ead241bb4605a774e55c14425c2c026 /xlators/protocol/client/src/client-handshake.c | |
| parent | 3d6efb17f12fa23482936ec7a5a666bbf9c0f78b (diff) | |
fix multiple transport related portmap issues in client handshake
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2258 (enhance gluster volume rebalance)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2258
Diffstat (limited to 'xlators/protocol/client/src/client-handshake.c')
| -rw-r--r-- | xlators/protocol/client/src/client-handshake.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 265c053c00e..71c5883ad43 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -857,6 +857,8 @@ 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; + /* TODO: more to test */ client_post_handshake (frame, frame->this); @@ -1117,6 +1119,8 @@ client_query_portmap (xlator_t *this, struct rpc_clnt *rpc) clnt_conf_t *conf = NULL; dict_t *options = NULL; char *remote_subvol = NULL; + char *xprt = NULL; + char brick_name[PATH_MAX] = {0,}; options = this->options; conf = this->private; @@ -1130,6 +1134,23 @@ 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; + } else { + conf->need_different_port = 0; + } + } + } + fr = create_frame (this, this->ctx->pool); if (!fr) { ret = -1; |
