summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2014-10-21 08:59:46 -0400
committerNiels de Vos <ndevos@redhat.com>2014-11-19 01:44:54 -0800
commitf380e2029d608f97e3ba9a728605e1d798b09e8d (patch)
treebaaaa86722f244efdd5cb23780c620627bb11398 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parentb9bd3666ae094f54c5049d03c7907a9dff14503d (diff)
rdma :mount fails for nfs protocol in rdma volumes
When we mount rdma only volume or tcp,rdma volume using newly peer probed IP's(nfs-server on new nodes) through nfs protocol, mount fails for rdma only volume and mount happens with help of tcp protocol in the case of tcp,rdma volumes. That is for newly added servers will always get transport type as "socket". This is due to nfs_transport_type is exported correctly and imported wrongly. This can be verified by the following , * Create a rdma only volume or tcp,rdma volume * Add a new server into the trusted pool. * Checkout the client transport type specified nfs-server volgraph.It will be always tcp(socket type) instead of rdma. * And also for rdma only volume in the nfs log, we can see 'connection refused' message for every reconnect between nfs server and glusterfsd. BUG: 1157381 Change-Id: I6bd4979e31adfc72af92c1da06a332557b6289e2 Author: Jiffin Tony Thottan <jthottan@redhat.com> Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/8975 Reviewed-by: Meghana M <mmadhusu@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index ea255f93208..247f369274f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1160,15 +1160,20 @@ get_vol_transport_type (glusterd_volinfo_t *volinfo, char *tt)
transport_type_to_str (volinfo->transport_type, tt);
}
+/* If no value has specfied for tcp,rdma volume from cli
+ * use tcp as default value.Otherwise, use transport type
+ * mentioned in volinfo
+ */
static void
get_vol_nfs_transport_type (glusterd_volinfo_t *volinfo, char *tt)
{
- if (volinfo->nfs_transport_type == GF_TRANSPORT_BOTH_TCP_RDMA) {
- gf_log ("", GF_LOG_ERROR, "%s:nfs transport cannot be both"
- " tcp and rdma", volinfo->volname);
- GF_ASSERT (0);
- }
- transport_type_to_str (volinfo->nfs_transport_type, tt);
+ if (volinfo->transport_type == GF_TRANSPORT_BOTH_TCP_RDMA) {
+ strcpy (tt, "tcp");
+ gf_log ("glusterd", GF_LOG_INFO,
+ "The default transport type for tcp,rdma volume "
+ "is tcp if option is not defined by the user ");
+ } else
+ transport_type_to_str (volinfo->transport_type, tt);
}
/* gets the volinfo, dict, a character array for filling in
@@ -3425,8 +3430,16 @@ build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict)
if (ret)
goto out;
- /* If both RDMA and TCP are the transport_type, use RDMA
- for NFS client protocols */
+ /* If both RDMA and TCP are the transport_type, use TCP for NFS
+ * client protocols, because tcp,rdma volume can be created in
+ * servers which does not have rdma supported hardware
+ * The transport type specified here is client transport type
+ * which is used for communication between gluster-nfs and brick
+ * processes.
+ * User can specify client transport for tcp,rdma volume using
+ * nfs.transport-type, if it is not set by user default
+ * one will be tcp.
+ */
memset (&cgraph, 0, sizeof (cgraph));
if (mod_dict)
get_transport_type (voliter, mod_dict, nfs_xprt, _gf_true);