summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2019-01-22 12:10:59 +0530
committerAmar Tumballi <amarts@redhat.com>2019-01-22 13:47:19 +0000
commitb6c417785e54620331ae35d6971fe8bef98b4619 (patch)
tree828099423d2cc2cfee056b0431ebd54a205d533f /xlators/mgmt/glusterd
parent67bc3775685198b9ab10c1f2a0d957b157bb4acd (diff)
rpc: use address-family option from vol file
This patch helps enable IPv6 connections in the cluster. The default address-family is IPv4 without using this option explicitly. When address-family is set to "inet6" in the /etc/glusterfs/glusterd.vol file, the mount command-line also needs to have -o xlator-option="transport.address-family=inet6" added to it. This option also gets added to the brick command-line. Snapshot and gfapi use-cases should also use this option to pass in the inet6 address-family. Change-Id: I97db91021af27bacb6d7578e33ea4817f66d7270 fixes: bz#1635863 Signed-off-by: Milind Changire <mchangir@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c11
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c7
2 files changed, 15 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index ab57c199954..614d34db670 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -3417,7 +3417,7 @@ out:
int
glusterd_transport_inet_options_build(dict_t **options, const char *hostname,
- int port)
+ int port, char *af)
{
xlator_t *this = NULL;
dict_t *dict = NULL;
@@ -3435,7 +3435,7 @@ glusterd_transport_inet_options_build(dict_t **options, const char *hostname,
port = GLUSTERD_DEFAULT_PORT;
/* Build default transport options */
- ret = rpc_transport_inet_options_build(&dict, hostname, port);
+ ret = rpc_transport_inet_options_build(&dict, hostname, port, af);
if (ret)
goto out;
@@ -3489,6 +3489,7 @@ glusterd_friend_rpc_create(xlator_t *this, glusterd_peerinfo_t *peerinfo,
int ret = -1;
glusterd_peerctx_t *peerctx = NULL;
data_t *data = NULL;
+ char *af = NULL;
peerctx = GF_CALLOC(1, sizeof(*peerctx), gf_gld_mt_peerctx_t);
if (!peerctx)
@@ -3504,8 +3505,12 @@ glusterd_friend_rpc_create(xlator_t *this, glusterd_peerinfo_t *peerinfo,
uniquely identify a
peerinfo */
+ ret = dict_get_str(this->options, "transport.address-family", &af);
+ if (ret)
+ gf_log(this->name, GF_LOG_TRACE,
+ "option transport.address-family is not set in xlator options");
ret = glusterd_transport_inet_options_build(&options, peerinfo->hostname,
- peerinfo->port);
+ peerinfo->port, af);
if (ret)
goto out;
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index fd6e360a730..1aa6947fbba 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2044,6 +2044,7 @@ glusterd_volume_start_glusterfs(glusterd_volinfo_t *volinfo,
int pid = -1;
int32_t len = 0;
glusterd_brick_proc_t *brick_proc = NULL;
+ char *inet_family = NULL;
GF_ASSERT(volinfo);
GF_ASSERT(brickinfo);
@@ -2219,6 +2220,12 @@ retry:
else if (volinfo->transport_type == GF_TRANSPORT_BOTH_TCP_RDMA)
runner_argprintf(&runner, "--volfile-server-transport=socket,rdma");
+ ret = dict_get_str(this->options, "transport.address-family", &inet_family);
+ if (!ret) {
+ runner_add_arg(&runner, "--xlator-option");
+ runner_argprintf(&runner, "transport.address-family=%s", inet_family);
+ }
+
if (volinfo->memory_accounting)
runner_add_arg(&runner, "--mem-accounting");