summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2017-10-10 14:45:03 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-10-18 14:15:05 +0000
commit77271e9c1efab628d00bc66803be923f451c0bfa (patch)
tree4e4183568a2fdda702ae5cdcd4624a53fc39b1cf /xlators/mgmt
parente848410ab6d13871be6b57101788ea5183efe75c (diff)
gfproxyd: Let glusterd manage gfproxy daemon
Updates: #242 BUG: 1428063 Change-Id: Iaaf2edf99b2ecc75f6d30762c752a6d445c1c826 Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/Makefile.am4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.c204
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.h51
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.c447
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.h47
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handshake.c7
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c20
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.c12
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c16
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c91
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.h6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c11
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h2
15 files changed, 849 insertions, 75 deletions
diff --git a/xlators/mgmt/glusterd/src/Makefile.am b/xlators/mgmt/glusterd/src/Makefile.am
index b0f5a9b540c..637c77b301d 100644
--- a/xlators/mgmt/glusterd/src/Makefile.am
+++ b/xlators/mgmt/glusterd/src/Makefile.am
@@ -19,7 +19,8 @@ glusterd_la_SOURCES = glusterd.c glusterd-handler.c glusterd-sm.c \
glusterd-nfs-svc.c glusterd-quotad-svc.c glusterd-svc-helper.c \
glusterd-conn-helper.c glusterd-snapd-svc.c glusterd-snapd-svc-helper.c \
glusterd-bitd-svc.c glusterd-scrub-svc.c glusterd-server-quorum.c \
- glusterd-reset-brick.c glusterd-tierd-svc.c glusterd-tierd-svc-helper.c
+ glusterd-reset-brick.c glusterd-tierd-svc.c glusterd-tierd-svc-helper.c \
+ glusterd-gfproxyd-svc.c glusterd-gfproxyd-svc-helper.c
glusterd_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
@@ -42,6 +43,7 @@ noinst_HEADERS = glusterd.h glusterd-utils.h glusterd-op-sm.h \
glusterd-snapd-svc-helper.h glusterd-rcu.h glusterd-bitd-svc.h \
glusterd-scrub-svc.h glusterd-server-quorum.h glusterd-errno.h \
glusterd-tierd-svc.h glusterd-tierd-svc-helper.h \
+ glusterd-gfproxyd-svc.h glusterd-gfproxyd-svc-helper.h \
$(CONTRIBDIR)/userspace-rcu/rculist-extra.h
AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \
diff --git a/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.c
new file mode 100644
index 00000000000..2949297788f
--- /dev/null
+++ b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.c
@@ -0,0 +1,204 @@
+/*
+ Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
+*/
+
+#include "glusterd.h"
+#include "glusterd-utils.h"
+#include "glusterd-gfproxyd-svc-helper.h"
+#include "glusterd-messages.h"
+#include "syscall.h"
+#include "glusterd-volgen.h"
+
+void
+glusterd_svc_build_gfproxyd_rundir (glusterd_volinfo_t *volinfo,
+ char *path, int path_len)
+{
+ char workdir[PATH_MAX] = {0,};
+ glusterd_conf_t *priv = THIS->private;
+
+ GLUSTERD_GET_VOLUME_PID_DIR (workdir, volinfo, priv);
+
+ snprintf (path, path_len, "%s", workdir);
+}
+
+void
+glusterd_svc_build_gfproxyd_socket_filepath (glusterd_volinfo_t *volinfo,
+ char *path, int path_len)
+{
+ char sockfilepath[PATH_MAX] = {0,};
+ char rundir[PATH_MAX] = {0,};
+
+ glusterd_svc_build_gfproxyd_rundir (volinfo, rundir, sizeof (rundir));
+ snprintf (sockfilepath, sizeof (sockfilepath), "%s/run-%s",
+ rundir, uuid_utoa (MY_UUID));
+
+ glusterd_set_socket_filepath (sockfilepath, path, path_len);
+}
+
+void
+glusterd_svc_build_gfproxyd_pidfile (glusterd_volinfo_t *volinfo,
+ char *path, int path_len)
+{
+ char rundir[PATH_MAX] = {0,};
+
+ glusterd_svc_build_gfproxyd_rundir (volinfo, rundir, sizeof (rundir));
+
+ snprintf (path, path_len, "%s/%s.gfproxyd.pid", rundir, volinfo->volname);
+}
+
+void
+glusterd_svc_build_gfproxyd_volfile_path (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_svc_build_gfproxyd_logdir (char *logdir, char *volname, size_t len)
+{
+ snprintf (logdir, len, "%s/gfproxy/%s", DEFAULT_LOG_FILE_DIRECTORY,
+ volname);
+}
+
+void
+glusterd_svc_build_gfproxyd_logfile (char *logfile, char *logdir, size_t len)
+{
+ snprintf (logfile, len, "%s/gfproxyd.log", logdir);
+}
+
+int
+glusterd_is_gfproxyd_enabled (glusterd_volinfo_t *volinfo)
+{
+ return glusterd_volinfo_get_boolean (volinfo, VKEY_CONFIG_GFPROXY);
+}
+
+static int
+glusterd_svc_get_gfproxyd_volfile (glusterd_volinfo_t *volinfo, char *svc_name,
+ char *orgvol, char *tmpvol, int path_len)
+{
+ int tmp_fd = -1;
+ int ret = -1;
+ int need_unlink = 0;
+
+ glusterd_svc_build_gfproxyd_volfile_path (volinfo, orgvol,
+ path_len);
+
+ snprintf (tmpvol, path_len, "/tmp/g%s-XXXXXX", svc_name);
+
+ tmp_fd = mkstemp (tmpvol);
+ if (tmp_fd < 0) {
+ gf_msg ("glusterd", GF_LOG_WARNING, errno,
+ GD_MSG_FILE_OP_FAILED, "Unable to create temp file"
+ " %s:(%s)", tmpvol, strerror (errno));
+ goto out;
+ }
+
+ need_unlink = 1;
+ ret = glusterd_build_gfproxyd_volfile (volinfo, tmpvol);
+
+out:
+ if (need_unlink && ret < 0)
+ sys_unlink (tmpvol);
+
+ if (tmp_fd >= 0)
+ sys_close (tmp_fd);
+
+ return ret;
+}
+
+int
+glusterd_svc_check_gfproxyd_volfile_identical (char *svc_name,
+ glusterd_volinfo_t *volinfo,
+ gf_boolean_t *identical)
+{
+ char orgvol[PATH_MAX] = {0,};
+ char tmpvol[PATH_MAX] = {0,};
+ int ret = -1;
+ int need_unlink = 0;
+
+ GF_VALIDATE_OR_GOTO ("glusterd", identical, out);
+
+ ret = glusterd_svc_get_gfproxyd_volfile (volinfo, svc_name, orgvol,
+ tmpvol, PATH_MAX);
+ if (ret)
+ goto out;
+
+ need_unlink = 1;
+ ret = glusterd_check_files_identical (orgvol, tmpvol,
+ identical);
+ if (ret)
+ goto out;
+
+out:
+ if (need_unlink)
+ sys_unlink (tmpvol);
+
+ return ret;
+}
+
+int
+glusterd_svc_check_gfproxyd_topology_identical (char *svc_name,
+ glusterd_volinfo_t *volinfo,
+ gf_boolean_t *identical)
+{
+ char orgvol[PATH_MAX] = {0,};
+ char tmpvol[PATH_MAX] = {0,};
+ int ret = -1;
+ int tmpclean = 0;
+
+ GF_VALIDATE_OR_GOTO ("glusterd", identical, out);
+
+ ret = glusterd_svc_get_gfproxyd_volfile (volinfo, svc_name, orgvol,
+ tmpvol, PATH_MAX);
+ if (ret)
+ goto out;
+
+ tmpclean = 1; /* SET the flag to unlink() tmpfile */
+
+ /* Compare the topology of volfiles */
+ ret = glusterd_check_topology_identical (orgvol, tmpvol,
+ identical);
+out:
+ if (tmpclean)
+ sys_unlink (tmpvol);
+ return ret;
+}
+
+glusterd_volinfo_t *
+glusterd_gfproxyd_volinfo_from_svc (glusterd_svc_t *svc)
+{
+ glusterd_volinfo_t *volinfo = NULL;
+ glusterd_gfproxydsvc_t *gfproxyd = NULL;
+
+ /* Get volinfo->gfproxyd from svc object */
+ gfproxyd = cds_list_entry (svc, glusterd_gfproxydsvc_t, svc);
+ if (!gfproxyd) {
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
+ GD_MSG_SNAPD_OBJ_GET_FAIL, "Failed to get gfproxyd "
+ "object from gfproxyd service");
+ goto out;
+ }
+
+ /* Get volinfo from gfproxyd */
+ volinfo = cds_list_entry (gfproxyd, glusterd_volinfo_t, gfproxyd);
+ if (!volinfo) {
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
+ GD_MSG_VOLINFO_GET_FAIL, "Failed to get volinfo from "
+ "from gfproxyd");
+ goto out;
+ }
+out:
+ return volinfo;
+}
diff --git a/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.h b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.h
new file mode 100644
index 00000000000..34a0e62a85a
--- /dev/null
+++ b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc-helper.h
@@ -0,0 +1,51 @@
+/*
+ Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
+*/
+
+#ifndef _GLUSTERD_GFPROXYD_SVC_HELPER_H_
+#define _GLUSTERD_GFPROXYD_SVC_HELPER_H_
+
+#include "glusterd.h"
+
+void
+glusterd_svc_build_gfproxyd_rundir (glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
+
+void
+glusterd_svc_build_gfproxyd_socket_filepath (glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
+
+void
+glusterd_svc_build_gfproxyd_pidfile (glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
+
+void
+glusterd_svc_build_gfproxyd_volfile_path (glusterd_volinfo_t *volinfo,
+ char *path, int path_len);
+
+void
+glusterd_svc_build_gfproxyd_logdir (char *logdir, char *volname, size_t len);
+
+void
+glusterd_svc_build_gfproxyd_logfile (char *logfile, char *logdir, size_t len);
+
+int
+glusterd_svc_check_gfproxyd_volfile_identical (char *svc_name,
+ glusterd_volinfo_t *volinfo,
+ gf_boolean_t *identical);
+int
+glusterd_svc_check_gfproxyd_topology_identical (char *svc_name,
+ glusterd_volinfo_t *volinfo,
+ gf_boolean_t *identical);
+int
+glusterd_is_gfproxyd_enabled (glusterd_volinfo_t *volinfo);
+
+glusterd_volinfo_t *
+glusterd_gfproxyd_volinfo_from_svc (glusterd_svc_t *svc);
+#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.c b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.c
new file mode 100644
index 00000000000..a3b0829d942
--- /dev/null
+++ b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.c
@@ -0,0 +1,447 @@
+/*
+ Copyright (c) 2014 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
+*/
+
+#include "globals.h"
+#include "run.h"
+#include "glusterd.h"
+#include "glusterd-utils.h"
+#include "glusterd-volgen.h"
+#include "glusterd-gfproxyd-svc.h"
+#include "glusterd-messages.h"
+#include "glusterd-svc-helper.h"
+#include "glusterd-svc-mgmt.h"
+#include "glusterd-gfproxyd-svc-helper.h"
+#include "syscall.h"
+
+void
+glusterd_gfproxydsvc_build (glusterd_svc_t *svc)
+{
+ svc->manager = glusterd_gfproxydsvc_manager;
+ svc->start = glusterd_gfproxydsvc_start;
+ svc->stop = glusterd_gfproxydsvc_stop;
+ svc->reconfigure = glusterd_gfproxydsvc_reconfigure;
+}
+
+
+int glusterd_gfproxydsvc_stop (glusterd_svc_t *svc, int sig)
+{
+ glusterd_volinfo_t *volinfo = NULL;
+ int ret = 0;
+
+ ret = glusterd_svc_stop (svc, sig);
+ if (ret)
+ goto out;
+
+ volinfo = glusterd_gfproxyd_volinfo_from_svc (svc);
+ volinfo->gfproxyd.port = 0;
+
+out:
+ return ret;
+}
+
+
+int glusterd_gfproxydsvc_init (glusterd_volinfo_t *volinfo)
+{
+ int ret = -1;
+ char rundir[PATH_MAX] = {0,};
+ char sockpath[PATH_MAX] = {0,};
+ char pidfile[PATH_MAX] = {0,};
+ char volfile[PATH_MAX] = {0,};
+ char logdir[PATH_MAX] = {0,};
+ char logfile[PATH_MAX] = {0,};
+ char volfileid[256] = {0};
+ glusterd_svc_t *svc = NULL;
+ glusterd_conf_t *priv = NULL;
+ glusterd_conn_notify_t notify = NULL;
+ xlator_t *this = NULL;
+ char *volfileserver = NULL;
+
+ this = THIS;
+ GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+
+ priv = this->private;
+ GF_VALIDATE_OR_GOTO (this->name, priv, out);
+
+ svc = &(volinfo->gfproxyd.svc);
+
+ ret = snprintf (svc->name, sizeof (svc->name), "%s", gfproxyd_svc_name);
+ if (ret < 0)
+ goto out;
+
+ notify = glusterd_svc_common_rpc_notify;
+
+ glusterd_svc_build_gfproxyd_rundir (volinfo, rundir, sizeof (rundir));
+ glusterd_svc_create_rundir (rundir);
+
+ /* Initialize the connection mgmt */
+ glusterd_svc_build_gfproxyd_socket_filepath (volinfo, sockpath,
+ sizeof (sockpath));
+ ret = glusterd_conn_init (&(svc->conn), sockpath, 600, notify);
+ if (ret)
+ goto out;
+
+ /* Initialize the process mgmt */
+ glusterd_svc_build_gfproxyd_pidfile (volinfo, pidfile, sizeof (pidfile));
+ glusterd_svc_build_gfproxyd_volfile_path (volinfo, volfile,
+ sizeof (volfile));
+ glusterd_svc_build_gfproxyd_logdir (logdir, volinfo->volname,
+ sizeof (logdir));
+ ret = mkdir_p (logdir, 0755, _gf_true);
+ if ((ret == -1) && (EEXIST != errno)) {
+ gf_msg (this->name, GF_LOG_ERROR, errno,
+ GD_MSG_CREATE_DIR_FAILED, "Unable to create logdir %s",
+ logdir);
+ goto out;
+ }
+ glusterd_svc_build_gfproxyd_logfile (logfile, logdir, sizeof (logfile));
+ snprintf (volfileid, sizeof (volfileid), "gfproxyd/%s", volinfo->volname);
+
+ if (dict_get_str (this->options, "transport.socket.bind-address",
+ &volfileserver) != 0) {
+ volfileserver = "localhost";
+ }
+ ret = glusterd_proc_init (&(svc->proc), gfproxyd_svc_name, pidfile,
+ logdir, logfile, volfile, volfileid,
+ volfileserver);
+ if (ret)
+ goto out;
+
+out:
+ gf_msg_debug (this ? this->name : "glusterd", 0, "Returning %d", ret);
+ return ret;
+}
+
+
+static int
+glusterd_gfproxydsvc_create_volfile (glusterd_volinfo_t *volinfo)
+{
+ int ret = -1;
+ xlator_t *this = NULL;
+
+ this = THIS;
+ GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+
+ ret = glusterd_generate_gfproxyd_volfile (volinfo);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_VOLFILE_CREATE_FAIL,
+ "Failed to create volfile");
+ goto out;
+ }
+
+out:
+ gf_msg_debug (this ? this->name : "glusterd", 0, "Returning %d", ret);
+
+ return ret;
+
+}
+
+int
+glusterd_gfproxydsvc_manager (glusterd_svc_t *svc, void *data, int flags)
+{
+ int ret = -1;
+ glusterd_volinfo_t *volinfo = NULL;
+ xlator_t *this = NULL;
+
+ this = THIS;
+ GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+
+ volinfo = data;
+ GF_VALIDATE_OR_GOTO (this->name, data, out);
+
+ if (!svc->inited) {
+ ret = glusterd_gfproxydsvc_init (volinfo);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_FAILED_INIT_QUOTASVC, "Failed to init "
+ "gfproxyd service");
+ goto out;
+ } else {
+ svc->inited = _gf_true;
+ gf_msg_debug (this->name, 0, "gfproxyd service "
+ "initialized");
+ }
+ }
+
+ ret = glusterd_is_gfproxyd_enabled (volinfo);
+ if (ret == -1) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_VOLINFO_GET_FAIL, "Failed to read volume "
+ "options");
+ goto out;
+ }
+
+ if (ret) {
+ if (!glusterd_is_volume_started (volinfo)) {
+ if (glusterd_proc_is_running (&svc->proc)) {
+ ret = svc->stop (svc, SIGTERM);
+ if (ret)
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_SNAPD_STOP_FAIL,
+ "Couldn't stop gfproxyd for "
+ "volume: %s",
+ volinfo->volname);
+ } else {
+ /* Since gfproxyd is not running set ret to 0 */
+ ret = 0;
+ }
+ goto out;
+ }
+
+ ret = glusterd_gfproxydsvc_create_volfile (volinfo);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_SNAPD_CREATE_FAIL, "Couldn't create "
+ "gfroxyd volfile for volume: %s",
+ volinfo->volname);
+ goto out;
+ }
+ ret = svc->stop (svc, SIGTERM);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_SNAPD_START_FAIL, "Couldn't stop "
+ "gfproxyd for volume: %s", volinfo->volname);
+ goto out;
+ }
+
+ ret = svc->start (svc, flags);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_SNAPD_START_FAIL, "Couldn't start "
+ "gfproxyd for volume: %s", volinfo->volname);
+ goto out;
+ }
+
+ glusterd_volinfo_ref (volinfo);
+ ret = glusterd_conn_connect (&(svc->conn));
+ if (ret) {
+ glusterd_volinfo_unref (volinfo);
+ goto out;
+ }
+
+ } else if (glusterd_proc_is_running (&svc->proc)) {
+ ret = svc->stop (svc, SIGTERM);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_SNAPD_STOP_FAIL,
+ "Couldn't stop gfproxyd for volume: %s",
+ volinfo->volname);
+ goto out;
+ }
+ }
+
+out:
+ if (ret) {
+ gf_event (EVENT_SVC_MANAGER_FAILED, "volume=%s;svc_name=%s",
+ volinfo->volname, svc->name);
+ }
+
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
+
+ return ret;
+}
+
+int
+glusterd_gfproxydsvc_start (glusterd_svc_t *svc, int flags)
+{
+ int ret = -1;
+ runner_t runner = {0,};
+ glusterd_conf_t *priv = NULL;
+ xlator_t *this = NULL;
+ char valgrind_logfile[PATH_MAX] = {0};
+ int gfproxyd_port = 0;
+ char msg[1024] = {0,};
+ char gfproxyd_id[PATH_MAX] = {0,};
+ glusterd_volinfo_t *volinfo = NULL;
+
+ this = THIS;
+ GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+
+ priv = this->private;
+ GF_VALIDATE_OR_GOTO (this->name, priv, out);
+
+ volinfo = glusterd_gfproxyd_volinfo_from_svc (svc);
+ if (!volinfo)
+ goto out;
+
+ ret = sys_access (svc->proc.volfile, F_OK);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_DEBUG, 0,
+ GD_MSG_VOLINFO_GET_FAIL,
+ "gfproxyd Volfile %s is not present", svc->proc.volfile);
+ ret = glusterd_gfproxydsvc_create_volfile (volinfo);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_VOLFILE_CREATE_FAIL, "Couldn't create "
+ "gfproxyd volfile for volume: %s",
+ volinfo->volname);
+ goto out;
+ }
+ }
+ runinit (&runner);
+
+ if (this->ctx->cmd_args.valgrind) {
+ snprintf (valgrind_logfile, PATH_MAX, "%s/valgrind-%s",
+ svc->proc.logdir, svc->proc.logfile);
+
+ runner_add_args (&runner, "valgrind", "--leak-check=full",
+ "--trace-children=yes", "--track-origins=yes",
+ NULL);
+ runner_argprintf (&runner, "--log-file=%s", valgrind_logfile);
+ }
+
+ snprintf (gfproxyd_id, sizeof (gfproxyd_id), "gfproxyd-%s",
+ volinfo->volname);
+ runner_add_args (&runner, SBIN_DIR"/glusterfsd",
+ "-s", svc->proc.volfileserver,
+ "--volfile-id", svc->proc.volfileid,
+ "-p", svc->proc.pidfile,
+ "-l", svc->proc.logfile,
+ "--brick-name", gfproxyd_id,
+ "-S", svc->conn.sockpath, NULL);
+
+ if (volinfo->memory_accounting)
+ runner_add_arg (&runner, "--mem-accounting");
+
+ gfproxyd_port = pmap_assign_port (this, volinfo->gfproxyd.port,
+ gfproxyd_id);
+ volinfo->gfproxyd.port = gfproxyd_port;
+
+ runner_add_arg (&runner, "--brick-port");
+ runner_argprintf (&runner, "%d", gfproxyd_port);
+ runner_add_arg (&runner, "--xlator-option");
+ runner_argprintf (&runner, "%s-server.listen-port=%d",
+ volinfo->volname, gfproxyd_port);
+
+ snprintf (msg, sizeof (msg),
+ "Starting the gfproxyd service for volume %s",
+ volinfo->volname);
+ runner_log (&runner, this->name, GF_LOG_DEBUG, msg);
+
+ if (flags == PROC_START_NO_WAIT) {
+ ret = runner_run_nowait (&runner);
+ } else {
+ synclock_unlock (&priv->big_lock);
+ {
+ ret = runner_run (&runner);
+ }
+ synclock_lock (&priv->big_lock);
+ }
+
+out:
+ return ret;
+}
+
+
+int
+glusterd_gfproxydsvc_restart ()
+{
+ glusterd_volinfo_t *volinfo = NULL;
+ int ret = -1;
+ xlator_t *this = THIS;
+ glusterd_conf_t *conf = NULL;
+ glusterd_svc_t *svc = NULL;
+
+ GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+
+ conf = this->private;
+ GF_VALIDATE_OR_GOTO (this->name, conf, out);
+
+ cds_list_for_each_entry (volinfo, &conf->volumes, vol_list) {
+ /* Start per volume gfproxyd svc */
+ if (volinfo->status == GLUSTERD_STATUS_STARTED) {
+ svc = &(volinfo->gfproxyd.svc);
+ ret = svc->manager (svc, volinfo, PROC_START_NO_WAIT);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_SNAPD_START_FAIL,
+ "Couldn't resolve gfproxyd for "
+ "vol: %s on restart", volinfo->volname);
+ gf_event (EVENT_SVC_MANAGER_FAILED,
+ "volume=%s;svc_name=%s",
+ volinfo->volname, svc->name);
+ goto out;
+ }
+ }
+ }
+out:
+ return ret;
+}
+
+
+int
+glusterd_gfproxydsvc_reconfigure (void *data)
+{
+ int ret = -1;
+ xlator_t *this = NULL;
+ gf_boolean_t identical = _gf_false;
+ glusterd_volinfo_t *volinfo = NULL;
+
+ volinfo = data;
+
+ this = THIS;
+ GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+
+ if (!volinfo->gfproxyd.svc.inited)
+ goto manager;
+
+ if (!glusterd_is_gfproxyd_enabled (volinfo))
+ goto manager;
+ else if (!glusterd_proc_is_running (&volinfo->gfproxyd.svc.proc))
+ goto manager;
+
+ /*
+ * Check both OLD and NEW volfiles, if they are SAME by size
+ * and cksum i.e. "character-by-character". If YES, then
+ * NOTHING has been changed, just return.
+ */
+ ret = glusterd_svc_check_gfproxyd_volfile_identical
+ (volinfo->gfproxyd.svc.name, volinfo, &identical);
+ if (ret)
+ goto out;
+
+ if (identical) {
+ ret = 0;
+ goto out;
+ }
+
+ /*
+ * They are not identical. Find out if the topology is changed
+ * OR just the volume options. If just the options which got
+ * changed, then inform the xlator to reconfigure the options.
+ */
+ identical = _gf_false; /* RESET the FLAG */
+ ret = glusterd_svc_check_gfproxyd_topology_identical
+ (volinfo->gfproxyd.svc.name, volinfo, &identical);
+ if (ret)
+ goto out;
+
+ /* Topology is not changed, but just the options. But write the
+ * options to gfproxyd volfile, so that gfproxyd will be reconfigured.
+ */
+ if (identical) {
+ ret = glusterd_gfproxydsvc_create_volfile (volinfo);
+ if (ret == 0) {/* Only if above PASSES */
+ ret = glusterd_fetchspec_notify (this);
+ }
+ goto out;
+ }
+manager:
+ /*
+ * gfproxyd volfile's topology has been changed. gfproxyd server needs
+ * to be RESTARTED to ACT on the changed volfile.
+ */
+ ret = volinfo->gfproxyd.svc.manager (&(volinfo->gfproxyd.svc), volinfo,
+ PROC_START_NO_WAIT);
+
+out:
+ gf_msg_debug ("glusterd", 0, "Returning %d", ret);
+ return ret;
+}
diff --git a/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.h b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.h
new file mode 100644
index 00000000000..a4af632a5b0
--- /dev/null
+++ b/xlators/mgmt/glusterd/src/glusterd-gfproxyd-svc.h
@@ -0,0 +1,47 @@
+/*
+ Copyright (c) 2006-2012 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
+*/
+
+#ifndef _GLUSTERD_GFPROXYD_SVC_H_
+#define _GLUSTERD_GFPROXYD_SVC_H_
+
+#include "glusterd-svc-mgmt.h"
+
+#define gfproxyd_svc_name "gfproxyd"
+
+struct glusterd_gfproxydsvc_ {
+ glusterd_svc_t svc;
+ int port;
+ gf_store_handle_t *handle;
+};
+
+typedef struct glusterd_gfproxydsvc_ glusterd_gfproxydsvc_t;
+
+void
+glusterd_gfproxydsvc_build (glusterd_svc_t *svc);
+
+int
+glusterd_gfproxydsvc_manager (glusterd_svc_t *svc, void *data, int flags);
+
+int
+glusterd_gfproxydsvc_start (glusterd_svc_t *svc, int flags);
+
+int
+glusterd_gfproxydsvc_stop (glusterd_svc_t *svc, int sig);
+
+int
+glusterd_gfproxydsvc_reconfigure ();
+
+void
+glusterd_gfproxydsvc_build_volfile_path (char *server, char *workdir,
+ char *volfile, size_t len);
+
+int
+glusterd_gfproxydsvc_restart ();
+#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c
index 8c397325260..8dc7e265b49 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handshake.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c
@@ -29,6 +29,7 @@
#include "protocol-common.h"
#include "rpcsvc.h"
#include "rpc-common-xdr.h"
+#include "glusterd-gfproxyd-svc-helper.h"
extern struct rpc_clnt_program gd_peer_prog;
extern struct rpc_clnt_program gd_mgmt_prog;
@@ -286,7 +287,7 @@ build_volfile_path (char *volume_id, char *path,
goto out;
}
- volid_ptr = strstr (volume_id, "gfproxy/");
+ volid_ptr = strstr (volume_id, "gfproxyd/");
if (volid_ptr) {
volid_ptr = strchr (volid_ptr, '/');
if (!volid_ptr) {
@@ -302,8 +303,8 @@ build_volfile_path (char *volume_id, char *path,
goto out;
}
- glusterd_get_gfproxyd_volfile (volinfo, path, path_len);
-
+ glusterd_svc_build_gfproxyd_volfile_path (volinfo, path,
+ path_len);
ret = 0;
goto out;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 28f36d7c268..f04cb2e7466 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -52,6 +52,7 @@
#include <sys/types.h>
#include <signal.h>
#include <sys/wait.h>
+#include "glusterd-gfproxyd-svc-helper.h"
extern char local_node_hostname[PATH_MAX];
static int
@@ -2175,6 +2176,10 @@ glusterd_options_reset (glusterd_volinfo_t *volinfo, char *key,
if (ret)
goto out;
}
+ svc = &(volinfo->gfproxyd.svc);
+ ret = svc->reconfigure (volinfo);
+ if (ret)
+ goto out;
ret = glusterd_create_volfiles_and_notify_services (volinfo);
if (ret) {
@@ -2619,6 +2624,11 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
goto out;
}
+ svc = &(volinfo->gfproxyd.svc);
+ ret = svc->reconfigure (volinfo);
+ if (ret)
+ goto out;
+
ret = glusterd_create_volfiles_and_notify_services (volinfo);
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
@@ -3019,6 +3029,11 @@ glusterd_op_set_volume (dict_t *dict, char **errstr)
if (ret)
goto out;
}
+ svc = &(volinfo->gfproxyd.svc);
+ ret = svc->reconfigure (volinfo);
+ if (ret)
+ goto out;
+
ret = glusterd_create_volfiles_and_notify_services (volinfo);
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
@@ -3063,6 +3078,11 @@ glusterd_op_set_volume (dict_t *dict, char **errstr)
goto out;
}
+ svc = &(volinfo->gfproxyd.svc);
+ ret = svc->reconfigure (volinfo);
+ if (ret)
+ goto out;
+
ret = glusterd_create_volfiles_and_notify_services (volinfo);
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c
index f83e8519ad9..18e5e5a3800 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.c
@@ -34,6 +34,7 @@
#include "glusterd-svc-helper.h"
#include "glusterd-snapshot-utils.h"
#include "glusterd-server-quorum.h"
+#include "glusterd-gfproxyd-svc-helper.h"
char local_node_hostname[PATH_MAX] = {0, };
@@ -745,6 +746,17 @@ glusterd_peer_detach_cleanup (glusterd_conf_t *priv)
"to stop tierd daemon service");
}
}
+
+ if (glusterd_is_gfproxyd_enabled (volinfo)) {
+ svc = &(volinfo->gfproxyd.svc);
+ ret = svc->stop (svc, SIGTERM);
+ if (ret) {
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
+ GD_MSG_SVC_STOP_FAIL, "Failed "
+ "to stop gfproxyd daemon service");
+ }
+ }
+
ret = glusterd_cleanup_snaps_for_volume (volinfo);
if (ret) {
gf_msg (THIS->name, GF_LOG_ERROR, 0,
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 623a3841f89..22f5865007f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -58,6 +58,7 @@
#include "glusterd-quotad-svc.h"
#include "glusterd-snapd-svc.h"
#include "glusterd-bitd-svc.h"
+#include "glusterd-gfproxyd-svc.h"
#include "glusterd-server-quorum.h"
#include "quota-common-utils.h"
#include "common-utils.h"
@@ -670,6 +671,7 @@ glusterd_volinfo_new (glusterd_volinfo_t **volinfo)
glusterd_snapdsvc_build (&new_volinfo->snapd.svc);
glusterd_tierdsvc_build (&new_volinfo->tierd.svc);
+ glusterd_gfproxydsvc_build (&new_volinfo->gfproxyd.svc);
pthread_mutex_init (&new_volinfo->reflock, NULL);
*volinfo = glusterd_volinfo_ref (new_volinfo);
@@ -3519,6 +3521,7 @@ glusterd_spawn_daemons (void *opaque)
glusterd_restart_rebalance (conf);
ret = glusterd_snapdsvc_restart ();
ret = glusterd_tierdsvc_restart ();
+ ret = glusterd_gfproxydsvc_restart ();
return ret;
}
@@ -12542,19 +12545,6 @@ glusterd_get_gfproxy_client_volfile (glusterd_volinfo_t *volinfo,
}
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 7e94c94ffc0..33c6fa38b59 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -742,10 +742,6 @@ 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 93b6e95d5f9..ac74c8a1fbd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -36,6 +36,7 @@
#include "glusterd-svc-mgmt.h"
#include "glusterd-svc-helper.h"
#include "glusterd-snapd-svc-helper.h"
+#include "glusterd-gfproxyd-svc-helper.h"
struct gd_validate_reconf_opts {
dict_t *options;
@@ -58,11 +59,6 @@ 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,
@@ -1518,10 +1514,6 @@ gfproxy_server_graph_builder (volgen_graph_t *graph,
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;
@@ -1530,13 +1522,15 @@ gfproxy_server_graph_builder (volgen_graph_t *graph,
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);
+ snprintf (key, sizeof (key),
+ "auth.login.gfproxyd-%s.allow",
+ volinfo->volname);
ret = xlator_set_option (xl, key, username);
if (ret)
return -1;
}
+ memset (key, 0, sizeof (key));
if (password) {
snprintf (key, sizeof (key), "auth.login.%s.password",
username);
@@ -1545,6 +1539,10 @@ gfproxy_server_graph_builder (volgen_graph_t *graph,
goto out;
}
+ memset (key, 0, sizeof (key));
+ snprintf (key, sizeof (key), "gfproxyd-%s", volinfo->volname);
+ ret = xlator_set_option (xl, "auth-path", key);
+
out:
return ret;
}
@@ -4325,7 +4323,8 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
int uss_enabled = -1;
xlator_t *this = THIS;
char *subvol = NULL;
- size_t subvol_namelen = 0;
+ size_t namelen = 0;
+ char *xl_id = NULL;
GF_ASSERT (this);
GF_ASSERT (conf);
@@ -4351,20 +4350,17 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
if (ret == -1)
goto out;
} else {
- ret = dict_get_str (set_dict,
- "config.gfproxyd-remote-host", &tmp);
- if (ret == -1)
- goto out;
+ namelen = strlen (volinfo->volname) + strlen ("gfproxyd-") + 1;
+ subvol = alloca (namelen);
+ snprintf (subvol, namelen, "gfproxyd-%s", volinfo->volname);
- 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);
+ namelen = strlen (volinfo->volname) +
+ strlen ("-gfproxy-client") + 1;
+ xl_id = alloca (namelen);
+ snprintf (xl_id, namelen, "%s-gfproxy-client",
+ volinfo->volname);
+ volgen_graph_build_client (graph, volinfo, NULL, NULL,
+ subvol, xl_id, "tcp", set_dict);
}
ret = dict_get_str_boolean (set_dict, "features.shard", _gf_false);
@@ -5500,20 +5496,6 @@ 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, };
- 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)
@@ -5559,23 +5541,14 @@ out:
return ret;
}
-static int
-glusterd_generate_gfproxyd_volfile (glusterd_volinfo_t *volinfo)
+int
+glusterd_build_gfproxyd_volfile (glusterd_volinfo_t *volinfo, char *filename)
{
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,
+ NULL, NULL,
&gfproxy_server_graph_builder);
if (ret == 0)
ret = volgen_write_volfile (&graph, filename);
@@ -5585,6 +5558,22 @@ glusterd_generate_gfproxyd_volfile (glusterd_volinfo_t *volinfo)
return ret;
}
+int
+glusterd_generate_gfproxyd_volfile (glusterd_volinfo_t *volinfo)
+{
+ char filename[PATH_MAX] = {0, };
+ int ret = -1;
+
+ GF_ASSERT (volinfo);
+
+ glusterd_svc_build_gfproxyd_volfile_path (volinfo, filename,
+ PATH_MAX - 1);
+
+ ret = glusterd_build_gfproxyd_volfile (volinfo, filename);
+
+ return ret;
+}
+
static int
glusterd_generate_brick_volfile (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *brickinfo,
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.h b/xlators/mgmt/glusterd/src/glusterd-volgen.h
index 2a8a6e6aed9..38a62393fd6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.h
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.h
@@ -37,6 +37,7 @@
#define VKEY_READDIR_AHEAD "performance.readdir-ahead"
#define VKEY_RDA_CACHE_LIMIT "performance.rda-cache-limit"
#define VKEY_RDA_REQUEST_SIZE "performance.rda-request-size"
+#define VKEY_CONFIG_GFPROXY "config.gfproxyd"
#define AUTH_ALLOW_MAP_KEY "auth.allow"
#define AUTH_REJECT_MAP_KEY "auth.reject"
@@ -310,4 +311,9 @@ gd_is_self_heal_enabled (glusterd_volinfo_t *volinfo, dict_t *dict);
int
generate_dummy_client_volfiles (glusterd_volinfo_t *volinfo);
+int
+glusterd_generate_gfproxyd_volfile (glusterd_volinfo_t *volinfo);
+
+int
+glusterd_build_gfproxyd_volfile (glusterd_volinfo_t *volinfo, char *filename);
#endif
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index a783a008b14..4cc67697491 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -2682,6 +2682,8 @@ glusterd_op_start_volume (dict_t *dict, char **op_errstr)
}
+ svc = &(volinfo->gfproxyd.svc);
+ ret = svc->manager (svc, volinfo, PROC_START_NO_WAIT);
ret = glusterd_svcs_manager (volinfo);
out:
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index d3f31d0c343..4b4e8da5e55 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -2820,10 +2820,15 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.option = "!config",
.op_version = 2
},
- { .key = "config.gfproxyd-remote-host",
+ { .key = VKEY_CONFIG_GFPROXY,
.voltype = "configuration",
- .option = "gfproxyd-remote-host",
- .op_version = 2
+ .option = "gfproxyd",
+ .value = "off",
+ .type = DOC,
+ .op_version = GD_OP_VERSION_3_13_0,
+ .description = "If this option is enabled, the proxy client daemon "
+ "called gfproxyd will be started on all the trusted "
+ "storage pool nodes"
},
{ .key = GLUSTERD_QUORUM_TYPE_KEY,
.voltype = "mgmt/glusterd",
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index afb43aecbf7..5d5b60477c9 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -38,6 +38,7 @@
#include "store.h"
#include "glusterd-rcu.h"
#include "events.h"
+#include "glusterd-gfproxyd-svc.h"
#define GLUSTERD_TR_LOG_SIZE 50
#define GLUSTERD_QUORUM_TYPE_KEY "cluster.server-quorum-type"
@@ -473,6 +474,7 @@ struct glusterd_volinfo_ {
glusterd_snapdsvc_t snapd;
glusterd_tierdsvc_t tierd;
+ glusterd_gfproxydsvc_t gfproxyd;
int32_t quota_xattr_version;
};