summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorNithin D <nithind1988@yahoo.in>2015-11-15 22:14:43 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-02-20 09:16:42 -0800
commit46bd29e0f2a7fc9278068a06d12066d614f365ec (patch)
tree52cbc91d42b513d9d128dc23ac7d47fa1cb5211e /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent759b63536c676f4b4fa135ea62d74dff021778e4 (diff)
glusterd: Bug fixes for IPv6 support
Problem: Glusterd not working using ipv6 transport. The idea is with proper glusterd.vol configuration, 1. glusterd needs to listen on default port (240007) as IPv6 TCP listner. 2. Volume creation/deletion/mounting/add-bricks/delete-bricks/peer-probe needs to work using ipv6 addresses. 3. Bricks needs to listen on ipv6 addresses. All the above functionality is needed to say that glusterd supports ipv6 transport and this is broken. Fix: When "option transport.address-family inet6" option is present in glusterd.vol file, it is made sure that glusterd creates listeners using ipv6 sockets only and also the same information is saved inside brick volume files used by glusterfsd brick process when they are starting. Tests Run: Regression tests using ./run-tests.sh IPv4: Ran manually till tests/basic/rpm.t . IPv6: (Need to add the above mentioned config and also add an entry for "hostname ::1" in /etc/hosts) Started failing at ./tests/basic/glusterd/arbiter-volume-probe.t and ran successfully till here Unit Tests using Ipv6 peer probe add-bricks remove-bricks create volume replace-bricks start volume stop volume delete volume Change-Id: Iebc96e6cce748b5924ce5da17b0114600ec70a6e BUG: 1117886 Signed-off-by: Nithin D <nithind1988@yahoo.in> Reviewed-on: http://review.gluster.org/11988 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index c808b07cbf2..cc599846bb9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -2210,6 +2210,7 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
char key[1024] = {0};
char *ssl_user = NULL;
char *value = NULL;
+ char *address_family_data = NULL;
if (!graph || !volinfo || !set_dict || !brickinfo)
goto out;
@@ -2246,6 +2247,17 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
RPC_SET_OPT(xl, SSL_DH_PARAM_OPT, "ssl-dh-param", return -1);
RPC_SET_OPT(xl, SSL_EC_CURVE_OPT, "ssl-ec-curve", return -1);
+ if (dict_get_str (volinfo->dict, "transport.address-family",
+ &address_family_data) == 0) {
+ ret = xlator_set_option (xl, "transport.address-family",
+ address_family_data);
+ if (ret) {
+ gf_log ("glusterd", GF_LOG_WARNING,
+ "failed to set transport.address-family");
+ return -1;
+ }
+ }
+
if (username) {
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "auth.login.%s.allow",
@@ -2293,6 +2305,7 @@ brick_graph_add_pump (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
char *password = NULL;
char *ptranst = NULL;
char *value = NULL;
+ char *address_family_data = NULL;
if (!graph || !volinfo || !set_dict)
@@ -2354,6 +2367,18 @@ brick_graph_add_pump (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
if (ret)
return -1;
+ if (dict_get_str (volinfo->dict, "transport.address-family",
+ &address_family_data) == 0) {
+ ret = xlator_set_option (rbxl,
+ "transport.address-family",
+ address_family_data);
+ if (ret) {
+ gf_log ("glusterd", GF_LOG_WARNING,
+ "failed to set transport.address-family");
+ return -1;
+ }
+ }
+
xl = volgen_graph_add_nolink (graph, "cluster/pump", "%s-pump",
volinfo->volname);
if (!xl)
@@ -2831,6 +2856,7 @@ volgen_graph_build_client (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
char *ssl_str = NULL;
gf_boolean_t ssl_bool = _gf_false;
char *value = NULL;
+ char *address_family_data = NULL;
GF_ASSERT (graph);
GF_ASSERT (subvol);
@@ -2860,6 +2886,18 @@ volgen_graph_build_client (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
if (ret)
goto err;
+ if (dict_get_str (volinfo->dict, "transport.address-family",
+ &address_family_data) == 0) {
+ ret = xlator_set_option (xl,
+ "transport.address-family",
+ address_family_data);
+ if (ret) {
+ gf_log ("glusterd", GF_LOG_WARNING,
+ "failed to set transport.address-family");
+ goto err;
+ }
+ }
+
ret = dict_get_uint32 (set_dict, "trusted-client",
&client_type);