summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c14
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handshake.c44
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c47
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h8
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c316
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.h3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c110
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h5
9 files changed, 531 insertions, 26 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index bf62290d023..3c21b9755ea 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -3418,7 +3418,7 @@ glusterd_transport_keepalive_options_get (int *interval, int *time,
int
glusterd_transport_inet_options_build (dict_t **options, const char *hostname,
- int port)
+ int port, char *addr_family)
{
dict_t *dict = NULL;
int32_t interval = -1;
@@ -3433,7 +3433,8 @@ 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,
+ addr_family);
if (ret)
goto out;
@@ -3470,6 +3471,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 *addr_family = NULL;
peerctx = GF_CALLOC (1, sizeof (*peerctx), gf_gld_mt_peerctx_t);
if (!peerctx)
@@ -3485,9 +3487,15 @@ glusterd_friend_rpc_create (xlator_t *this, glusterd_peerinfo_t *peerinfo,
uniquely identify a
peerinfo */
+ if (dict_get_str(this->options, "transport.address-family",
+ &addr_family)) {
+ addr_family = NULL;
+ }
+
ret = glusterd_transport_inet_options_build (&options,
peerinfo->hostname,
- peerinfo->port);
+ peerinfo->port,
+ addr_family);
if (ret)
goto out;
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c
index 0ea66a027bf..4fdff3402f5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handshake.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c
@@ -241,6 +241,50 @@ build_volfile_path (char *volume_id, char *path,
}
+ volid_ptr = strstr (volume_id, "gfproxy-client/");
+ if (volid_ptr) {
+ volid_ptr = strchr (volid_ptr, '/');
+ if (!volid_ptr) {
+ ret = -1;
+ goto out;
+ }
+ volid_ptr++;
+
+ ret = glusterd_volinfo_find (volid_ptr, &volinfo);
+ if (ret == -1) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Couldn't find volinfo");
+ goto out;
+ }
+
+ glusterd_get_gfproxy_client_volfile (volinfo, path, path_len);
+
+ ret = 0;
+ goto out;
+ }
+
+ volid_ptr = strstr (volume_id, "gfproxy/");
+ if (volid_ptr) {
+ volid_ptr = strchr (volid_ptr, '/');
+ if (!volid_ptr) {
+ ret = -1;
+ goto out;
+ }
+ volid_ptr++;
+
+ ret = glusterd_volinfo_find (volid_ptr, &volinfo);
+ if (ret == -1) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Couldn't find volinfo");
+ goto out;
+ }
+
+ glusterd_get_gfproxyd_volfile (volinfo, path, path_len);
+
+ ret = 0;
+ goto out;
+ }
+
volid_ptr = strstr (volume_id, "/snaps/");
if (volid_ptr) {
ret = get_snap_volname_and_volinfo (volid_ptr, &volname,
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index e7ae9b7848d..bd394fc31ba 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1791,6 +1791,7 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
int port = 0;
int rdma_port = 0;
char *bind_address = NULL;
+ char *addr_family = NULL;
char socketpath[PATH_MAX] = {0};
char glusterd_uuid[1024] = {0,};
char valgrind_logfile[PATH_MAX] = {0};
@@ -1913,6 +1914,13 @@ retry:
bind_address);
}
+ if (dict_get_str (this->options, "transport.address-family",
+ &addr_family) == 0) {
+ runner_add_arg (&runner, "--xlator-option");
+ runner_argprintf (&runner, "*.transport.address-family=%s",
+ addr_family);
+ }
+
if (volinfo->transport_type == GF_TRANSPORT_RDMA)
runner_argprintf (&runner, "--volfile-server-transport=rdma");
else if (volinfo->transport_type == GF_TRANSPORT_BOTH_TCP_RDMA)
@@ -10796,6 +10804,45 @@ out:
}
void
+glusterd_get_gfproxy_client_volfile (glusterd_volinfo_t *volinfo,
+ char *path, int path_len)
+{
+ char workdir[PATH_MAX] = {0, };
+ glusterd_conf_t *priv = THIS->private;
+
+ GLUSTERD_GET_VOLUME_DIR (workdir, volinfo, priv);
+
+ switch (volinfo->transport_type) {
+ case GF_TRANSPORT_TCP:
+ snprintf (path, path_len,
+ "%s/trusted-%s.tcp-gfproxy-fuse.vol",
+ workdir, volinfo->volname);
+ break;
+
+ case GF_TRANSPORT_RDMA:
+ snprintf (path, path_len,
+ "%s/trusted-%s.rdma-gfproxy-fuse.vol",
+ workdir, volinfo->volname);
+ break;
+ default:
+ break;
+ }
+}
+
+void
+glusterd_get_gfproxyd_volfile (glusterd_volinfo_t *volinfo,
+ char *path, int path_len)
+{
+ char workdir[PATH_MAX] = {0, };
+ glusterd_conf_t *priv = THIS->private;
+
+ GLUSTERD_GET_VOLUME_DIR (workdir, volinfo, priv);
+
+ snprintf (path, path_len, "%s/%s.gfproxyd.vol", workdir,
+ volinfo->volname);
+}
+
+void
glusterd_get_rebalance_volfile (glusterd_volinfo_t *volinfo,
char *path, int path_len)
{
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h
index f4c4138829f..7445407c010 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -642,6 +642,14 @@ void
glusterd_get_rebalance_volfile (glusterd_volinfo_t *volinfo,
char *path, int path_len);
+void
+glusterd_get_gfproxy_client_volfile (glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
+
+void
+glusterd_get_gfproxyd_volfile (glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
+
int32_t
glusterd_brickinfo_dup (glusterd_brickinfo_t *brickinfo,
glusterd_brickinfo_t *dup_brickinfo);
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 25fb23f72b2..2344fd169f1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -58,6 +58,20 @@ extern struct volopt_map_entry glusterd_volopt_map[];
} \
} while (0 /* CONSTCOND */)
+/**
+ * Needed for GFProxy
+ */
+#define GF_PROXY_DAEMON_PORT 40000
+#define GF_PROXY_DAEMON_PORT_STR "40000"
+
+static int
+volgen_graph_build_clients (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
+ dict_t *set_dict, void *param);
+
+static int
+build_client_graph (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
+ dict_t *mod_dict);
+
/*********************************************
*
* xlator generation / graph manipulation API
@@ -1448,6 +1462,75 @@ server_spec_extended_option_handler (volgen_graph_t *graph,
static void get_vol_tstamp_file (char *filename, glusterd_volinfo_t *volinfo);
static int
+gfproxy_server_graph_builder (volgen_graph_t *graph,
+ glusterd_volinfo_t *volinfo,
+ dict_t *set_dict, void *param)
+{
+ xlator_t *xl = NULL;
+ char *value = NULL;
+ char transt[16] = {0, };
+ char key[1024] = {0, };
+ char port_str[7] = {0, };
+ int ret = 0;
+ char *username = NULL;
+ char *password = NULL;
+ int rclusters = 0;
+
+ /* We are a trusted client */
+ ret = dict_set_uint32 (set_dict, "trusted-client", GF_CLIENT_TRUSTED);
+ if (ret != 0)
+ goto out;
+
+ ret = dict_set_str (set_dict, "gfproxy-server", "on");
+ if (ret != 0)
+ goto out;
+
+ /* Build the client section of the graph first */
+ build_client_graph (graph, volinfo, set_dict);
+
+ /* Clear this setting so that future users of set_dict do not end up
+ * thinking they are a gfproxy server */
+ dict_del (set_dict, "gfproxy-server");
+ dict_del (set_dict, "trusted-client");
+
+ /* Then add the server to it */
+ get_vol_transport_type (volinfo, transt);
+ xl = volgen_graph_add (graph, "protocol/server", volinfo->volname);
+ if (!xl)
+ goto out;
+
+ ret = xlator_set_option (xl, "listen-port", GF_PROXY_DAEMON_PORT_STR);
+ if (ret != 0)
+ goto out;
+
+ ret = xlator_set_option (xl, "transport-type", transt);
+ if (ret != 0)
+ goto out;
+
+ /* Set username and password */
+ username = glusterd_auth_get_username (volinfo);
+ password = glusterd_auth_get_password (volinfo);
+ if (username) {
+ snprintf (key, sizeof (key), "auth.login.%s-server.allow",
+ volinfo->volname);
+ ret = xlator_set_option (xl, key, username);
+ if (ret)
+ return -1;
+ }
+
+ if (password) {
+ snprintf (key, sizeof (key), "auth.login.%s.password",
+ username);
+ ret = xlator_set_option (xl, key, password);
+ if (ret != 0)
+ goto out;
+ }
+
+out:
+ return ret;
+}
+
+static int
brick_graph_add_posix (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
dict_t *set_dict, glusterd_brickinfo_t *brickinfo)
{
@@ -2541,6 +2624,48 @@ perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme,
}
static int
+gfproxy_server_perfxl_option_handler (volgen_graph_t *graph,
+ struct volopt_map_entry *vme,
+ void *param)
+{
+ gf_boolean_t enabled = _gf_false;
+ glusterd_volinfo_t *volinfo = NULL;
+
+ GF_ASSERT (param);
+ volinfo = param;
+
+ /* write-behind is the *not* allowed for gfproxy-servers */
+ if (strstr (vme->key, "write-behind")) {
+ return 0;
+ }
+
+ perfxl_option_handler (graph, vme, param);
+
+ return 0;
+}
+
+static int
+gfproxy_client_perfxl_option_handler (volgen_graph_t *graph,
+ struct volopt_map_entry *vme,
+ void *param)
+{
+ gf_boolean_t enabled = _gf_false;
+ glusterd_volinfo_t *volinfo = NULL;
+
+ GF_ASSERT (param);
+ volinfo = param;
+
+ /* write-behind is the only allowed "perf" for gfproxy-clients */
+ if (!strstr (vme->key, "write-behind"))
+ return 0;
+
+ perfxl_option_handler (graph, vme, param);
+
+ return 0;
+}
+
+
+static int
nfsperfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme,
void *param)
{
@@ -2768,8 +2893,10 @@ _free_xlator_opt_key (char *key)
}
static xlator_t *
-volgen_graph_build_client (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
- char *hostname, char *subvol, char *xl_id,
+volgen_graph_build_client (volgen_graph_t *graph,
+ glusterd_volinfo_t *volinfo,
+ char *hostname, char *port,
+ char *subvol, char *xl_id,
char *transt, dict_t *set_dict)
{
xlator_t *xl = NULL;
@@ -2801,6 +2928,12 @@ volgen_graph_build_client (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
goto err;
}
+ if (port) {
+ ret = xlator_set_option (xl, "remote-port", port);
+ if (ret)
+ goto err;
+ }
+
ret = xlator_set_option (xl, "remote-subvolume", subvol);
if (ret)
goto err;
@@ -2824,7 +2957,8 @@ volgen_graph_build_client (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
ret = dict_get_uint32 (set_dict, "trusted-client",
&client_type);
- if (!ret && client_type == GF_CLIENT_TRUSTED) {
+ if (!ret && (client_type == GF_CLIENT_TRUSTED
+ || client_type == GF_CLIENT_TRUSTED_PROXY)) {
str = NULL;
str = glusterd_auth_get_username (volinfo);
if (str) {
@@ -2911,7 +3045,9 @@ volgen_graph_build_clients (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
i = 0;
cds_list_for_each_entry (brick, &volinfo->bricks, brick_list) {
xl = volgen_graph_build_client (graph, volinfo,
- brick->hostname, brick->path,
+ brick->hostname,
+ NULL,
+ brick->path,
brick->brick_id,
transt, set_dict);
if (!xl) {
@@ -3143,8 +3279,9 @@ volgen_graph_build_snapview_client (volgen_graph_t *graph,
get_transport_type (volinfo, set_dict, transt, _gf_false);
- prot_clnt = volgen_graph_build_client (graph, volinfo, NULL, subvol,
- xl_id, transt, set_dict);
+ prot_clnt = volgen_graph_build_client (graph, volinfo,
+ NULL, NULL, subvol,
+ xl_id, transt, set_dict);
if (!prot_clnt) {
ret = -1;
goto out;
@@ -3555,6 +3692,27 @@ static int client_graph_set_perf_options(volgen_graph_t *graph,
{
data_t *tmp_data = NULL;
char *volname = NULL;
+ int ret = 0;
+
+ /*
+ * Logic to make sure gfproxy-client gets custom performance translators
+ */
+ ret = dict_get_str_boolean (set_dict, "gfproxy-client", 0);
+ if (ret == 1) {
+ return volgen_graph_set_options_generic (
+ graph, set_dict, volinfo,
+ &gfproxy_client_perfxl_option_handler);
+ }
+
+ /*
+ * Logic to make sure gfproxy-server gets custom performance translators
+ */
+ ret = dict_get_str_boolean (set_dict, "gfproxy-server", 0);
+ if (ret == 1) {
+ return volgen_graph_set_options_generic (
+ graph, set_dict, volinfo,
+ &gfproxy_server_perfxl_option_handler);
+ }
/*
* Logic to make sure NFS doesn't have performance translators by
@@ -3768,29 +3926,55 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
char *volname = NULL;
glusterd_conf_t *conf = THIS->private;
char *tmp = NULL;
+ char *hostname = NULL;
gf_boolean_t var = _gf_false;
gf_boolean_t ob = _gf_false;
+ gf_boolean_t is_gfproxy = _gf_false;
int uss_enabled = -1;
xlator_t *this = THIS;
+ char *subvol = NULL;
+ size_t subvol_namelen = 0;
GF_ASSERT (this);
GF_ASSERT (conf);
- volname = volinfo->volname;
- ret = volgen_graph_build_clients (graph, volinfo, set_dict,
- param);
- if (ret)
+ ret = dict_get_str_boolean (set_dict, "gfproxy-client", 0);
+ if (ret == -1)
goto out;
- if (volinfo->type == GF_CLUSTER_TYPE_TIER)
- ret = volume_volgen_graph_build_clusters_tier
- (graph, volinfo, _gf_false);
- else
- ret = volume_volgen_graph_build_clusters
- (graph, volinfo, _gf_false);
+ volname = volinfo->volname;
+ if (ret == 0) {
+ ret = volgen_graph_build_clients (graph, volinfo, set_dict,
+ param);
+ if (ret)
+ goto out;
- if (ret == -1)
- goto out;
+ if (volinfo->type == GF_CLUSTER_TYPE_TIER)
+ ret = volume_volgen_graph_build_clusters_tier
+ (graph, volinfo, _gf_false);
+ else
+ ret = volume_volgen_graph_build_clusters
+ (graph, volinfo, _gf_false);
+
+ if (ret == -1)
+ goto out;
+ } else {
+ is_gfproxy = _gf_true;
+ ret = dict_get_str (set_dict,
+ "config.gfproxyd-remote-host", &tmp);
+ if (ret == -1)
+ goto out;
+
+ subvol_namelen = strlen (volinfo->volname) +
+ strlen ("-server") + 1;
+ subvol = alloca (subvol_namelen);
+ snprintf (subvol, subvol_namelen,
+ "%s-server", volinfo->volname);
+
+ volgen_graph_build_client (graph, volinfo, tmp,
+ GF_PROXY_DAEMON_PORT_STR, subvol,
+ "gfproxy", "tcp", set_dict);
+ }
ret = dict_get_str_boolean (set_dict, "features.shard", _gf_false);
if (ret == -1)
@@ -3851,6 +4035,15 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
}
}
+ /* gfproxy needs the AHA translator */
+ if (is_gfproxy) {
+ xl = volgen_graph_add (graph, "cluster/aha", volname);
+ if (!xl) {
+ ret = -1;
+ goto out;
+ }
+ }
+
if (conf->op_version == GD_OP_VERSION_MIN) {
ret = glusterd_volinfo_get_boolean (volinfo,
VKEY_FEATURES_QUOTA);
@@ -4731,6 +4924,24 @@ out:
return ret;
}
+static int
+volgen_graph_set_iam_nfsd (const volgen_graph_t *graph)
+{
+ xlator_t *trav;
+ int ret = 0;
+
+ for (trav = first_of ((volgen_graph_t *)graph); trav;
+ trav = trav->next) {
+ if (strcmp (trav->type, "cluster/replicate") != 0)
+ continue;
+
+ ret = xlator_set_option (trav, "iam-nfs-daemon", "yes");
+ if (ret)
+ break;
+ }
+ return ret;
+}
+
/* builds a graph for nfs server role, with option overrides in mod_dict */
int
build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict)
@@ -4869,6 +5080,10 @@ build_nfs_graph (volgen_graph_t *graph, dict_t *mod_dict)
if (ret)
goto out;
+ ret = volgen_graph_set_iam_nfsd (&cgraph);
+ if (ret)
+ goto out;
+
ret = volgen_graph_merge_sub (graph, &cgraph, 1);
if (ret)
goto out;
@@ -4930,6 +5145,22 @@ get_brick_filepath (char *filename, glusterd_volinfo_t *volinfo,
brickinfo->hostname, brick);
}
+static void
+get_gfproxyd_filepath (char *filename, glusterd_volinfo_t *volinfo)
+{
+ char path[PATH_MAX] = {0, };
+ char brick[PATH_MAX] = {0, };
+ glusterd_conf_t *priv = NULL;
+
+ priv = THIS->private;
+
+ GLUSTERD_GET_VOLUME_DIR (path, volinfo, priv);
+
+ snprintf (filename, PATH_MAX,
+ "%s/%s.gfproxyd.vol", path,
+ volinfo->volname);
+}
+
gf_boolean_t
glusterd_is_valid_volfpath (char *volname, char *brick)
{
@@ -4975,6 +5206,32 @@ out:
}
static int
+glusterd_generate_gfproxyd_volfile (glusterd_volinfo_t *volinfo)
+{
+ volgen_graph_t graph = {0, };
+ char filename[PATH_MAX] = {0, };
+ int ret = -1;
+
+ GF_ASSERT (volinfo);
+
+ get_gfproxyd_filepath (filename, volinfo);
+
+ struct glusterd_gfproxyd_info info = {
+ .port = GF_PROXY_DAEMON_PORT,
+ };
+
+ ret = build_graph_generic (&graph, volinfo,
+ NULL, &info,
+ &gfproxy_server_graph_builder);
+ if (ret == 0)
+ ret = volgen_write_volfile (&graph, filename);
+
+ volgen_graph_free (&graph);
+
+ return ret;
+}
+
+static int
glusterd_generate_brick_volfile (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo,
dict_t *mod_dict, void *data)
@@ -5245,7 +5502,8 @@ glusterd_generate_client_per_brick_volfile (glusterd_volinfo_t *volinfo)
cds_list_for_each_entry (brick, &volinfo->bricks, brick_list) {
xl = volgen_graph_build_client (&graph, volinfo,
- brick->hostname, brick->path,
+ brick->hostname,
+ NULL, brick->path,
brick->brick_id,
"tcp", dict);
if (!xl) {
@@ -5376,6 +5634,11 @@ generate_client_volfiles (glusterd_volinfo_t *volinfo,
ret = glusterd_get_trusted_client_filepath (filepath,
volinfo,
type);
+ } else if (client_type == GF_CLIENT_TRUSTED_PROXY) {
+ glusterd_get_gfproxy_client_volfile (volinfo,
+ filepath,
+ PATH_MAX);
+ ret = dict_set_str (dict, "gfproxy-client", "on");
} else {
ret = glusterd_get_client_filepath (filepath,
volinfo,
@@ -5620,6 +5883,7 @@ build_bitd_volume_graph (volgen_graph_t *graph,
xl = volgen_graph_build_client (&cgraph, volinfo,
brickinfo->hostname,
+ NULL,
brickinfo->path,
brickinfo->brick_id,
transt, set_dict);
@@ -5782,6 +6046,7 @@ build_scrub_volume_graph (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
xl = volgen_graph_build_client (&cgraph, volinfo,
brickinfo->hostname,
+ NULL,
brickinfo->path,
brickinfo->brick_id,
transt, set_dict);
@@ -5913,12 +6178,25 @@ glusterd_create_volfiles (glusterd_volinfo_t *volinfo)
goto out;
}
+ ret = generate_client_volfiles (volinfo, GF_CLIENT_TRUSTED_PROXY);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Could not generate gfproxy client volfiles");
+ goto out;
+ }
+
ret = generate_client_volfiles (volinfo, GF_CLIENT_OTHER);
if (ret)
gf_msg (this->name, GF_LOG_ERROR, 0,
GD_MSG_VOLFILE_CREATE_FAIL,
"Could not generate client volfiles");
+
+ ret = glusterd_generate_gfproxyd_volfile (volinfo);
+ if (ret)
+ gf_log (this->name, GF_LOG_ERROR,
+ "Could not generate gfproxy volfiles");
+
out:
return ret;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.h b/xlators/mgmt/glusterd/src/glusterd-volgen.h
index f90177372dc..cb2cad50efc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.h
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.h
@@ -52,7 +52,8 @@
typedef enum {
GF_CLIENT_TRUSTED,
- GF_CLIENT_OTHER
+ GF_CLIENT_OTHER,
+ GF_CLIENT_TRUSTED_PROXY,
} glusterd_client_type_t;
struct volgen_graph {
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index bade4ffb06d..61c79655ccf 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -286,6 +286,11 @@ __glusterd_handle_create_volume (rpcsvc_request_t *req)
int32_t type = 0;
char *username = NULL;
char *password = NULL;
+#ifdef IPV6_DEFAULT
+ char *addr_family = "inet6";
+#else
+ char *addr_family = "inet";
+#endif
GF_ASSERT (req);
@@ -388,10 +393,11 @@ __glusterd_handle_create_volume (rpcsvc_request_t *req)
/* Setting default as inet for trans_type tcp */
ret = dict_set_dynstr_with_alloc (dict,
"transport.address-family",
- "inet");
+ addr_family);
if (ret) {
gf_log (this->name, GF_LOG_ERROR,
- "failed to set transport.address-family");
+ "failed to set transport.address-family "
+ "to %s", addr_family);
goto out;
}
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 1e24adabe0c..bcb8877c5bd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -1048,6 +1048,11 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.op_version = 1,
.flags = OPT_FLAG_CLIENT_OPT
},
+ { .key = "cluster.min-free-strict-mode",
+ .voltype = "cluster/distribute",
+ .op_version = 1,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
{ .key = "cluster.min-free-inodes",
.voltype = "cluster/distribute",
.op_version = 1,
@@ -1113,6 +1118,13 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.flags = OPT_FLAG_CLIENT_OPT,
},
+ { .key = "cluster.du-refresh-interval-sec",
+ .voltype = "cluster/distribute",
+ .option = "du-refresh-interval-sec",
+ .op_version = 1,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+
/* NUFA xlator options (Distribute special case) */
{ .key = "cluster.nufa",
.voltype = "cluster/distribute",
@@ -1461,6 +1473,11 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.option = "thread-count",
.op_version = 1
},
+ { .key = "performance.io-thread-fops-per-thread-ratio",
+ .voltype = "performance/io-threads",
+ .option = "fops-per-thread-ratio",
+ .op_version = 1
+ },
{ .key = "performance.high-prio-threads",
.voltype = "performance/io-threads",
.op_version = 1
@@ -1555,6 +1572,18 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.op_version = 2,
.flags = OPT_FLAG_CLIENT_OPT
},
+ { .key = "performance.write-behind-trickling-writes",
+ .voltype = "performance/write-behind",
+ .option = "trickling-writes",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+ { .key = "performance.nfs.write-behind-trickling-writes",
+ .voltype = "performance/write-behind",
+ .option = "trickling-writes",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
{ .key = "performance.lazy-open",
.voltype = "performance/open-behind",
.option = "lazy-open",
@@ -2500,6 +2529,14 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.voltype = "storage/posix",
.op_version = GD_OP_VERSION_3_6_0,
},
+ { .key = "storage.min-free-disk",
+ .voltype = "storage/posix",
+ .op_version = 2,
+ },
+ { .key = "storage.freespace-check-interval",
+ .voltype = "storage/posix",
+ .op_version = 2,
+ },
{ .key = "storage.bd-aio",
.voltype = "storage/bd",
.op_version = 3
@@ -2515,6 +2552,11 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.option = "!config",
.op_version = 2
},
+ { .key = "config.gfproxyd-remote-host",
+ .voltype = "configuration",
+ .option = "gfproxyd-remote-host",
+ .op_version = 2
+ },
{ .key = GLUSTERD_QUORUM_TYPE_KEY,
.voltype = "mgmt/glusterd",
.value = "off",
@@ -2961,7 +3003,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
{ .key = "cluster.locking-scheme",
.voltype = "cluster/replicate",
.type = DOC,
- .op_version = GD_OP_VERSION_3_7_12,
+ .op_version = GD_OP_VERSION_3_7_12 ,
.flags = OPT_FLAG_CLIENT_OPT
},
{ .key = "cluster.granular-entry-heal",
@@ -2970,6 +3012,72 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.op_version = GD_OP_VERSION_3_8_0,
.flags = OPT_FLAG_CLIENT_OPT
},
+ { .option = "revocation-secs",
+ .key = "features.locks-revocation-secs",
+ .voltype = "features/locks",
+ .op_version = GD_OP_VERSION_3_6_0,
+ },
+ { .option = "revocation-clear-all",
+ .key = "features.locks-revocation-clear-all",
+ .voltype = "features/locks",
+ .op_version = GD_OP_VERSION_3_6_0,
+ },
+ { .option = "revocation-max-blocked",
+ .key = "features.locks-revocation-max-blocked",
+ .voltype = "features/locks",
+ .op_version = GD_OP_VERSION_3_6_0,
+ },
+ { .option = "monkey-unlocking",
+ .key = "features.locks-monkey-unlocking",
+ .voltype = "features/locks",
+ .op_version = GD_OP_VERSION_3_6_0,
+ .type = NO_DOC,
+ },
+ { .key = "cluster.halo-enabled",
+ .voltype = "cluster/replicate",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+ { .key = "cluster.halo-hybrid-mode",
+ .voltype = "cluster/replicate",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+ { .key = "cluster.halo-failover-enabled",
+ .voltype = "cluster/replicate",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+ { .key = "cluster.halo-shd-max-latency",
+ .voltype = "cluster/replicate",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+ { .key = "cluster.halo-nfsd-max-latency",
+ .voltype = "cluster/replicate",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+ { .key = "cluster.halo-max-latency",
+ .voltype = "cluster/replicate",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+ { .key = "cluster.halo-max-replicas",
+ .voltype = "cluster/replicate",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+ { .key = "cluster.halo-min-replicas",
+ .voltype = "cluster/replicate",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
+ { .key = "cluster.halo-min-samples",
+ .voltype = "cluster/replicate",
+ .op_version = 2,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
{ .key = NULL
}
};
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index bb6af7f378f..4795f958038 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -222,6 +222,11 @@ struct glusterd_brickinfo {
typedef struct glusterd_brickinfo glusterd_brickinfo_t;
+struct glusterd_gfproxyd_info {
+ short port;
+ char *logfile;
+};
+
struct gf_defrag_brickinfo_ {
char *name;
int files;