summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-messages.h10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c56
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c8
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h1
4 files changed, 68 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h
index e66107c3b24..9161d9058f0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-messages.h
+++ b/xlators/mgmt/glusterd/src/glusterd-messages.h
@@ -41,7 +41,7 @@
#define GLUSTERD_COMP_BASE GLFS_MSGID_GLUSTERD
-#define GLFS_NUM_MESSAGES 601
+#define GLFS_NUM_MESSAGES 602
#define GLFS_MSGID_END (GLUSTERD_COMP_BASE + GLFS_NUM_MESSAGES + 1)
/* Messaged with message IDs */
@@ -4861,6 +4861,14 @@
*/
#define GD_MSG_PIDFILE_UNLINKING (GLUSTERD_COMP_BASE + 601)
+/*!
+ * @messageid
+ * @diagnosis
+ * @recommendedaction
+ *
+ */
+#define GD_MSG_VOL_SET_VALIDATION_INFO (GLUSTERD_COMP_BASE + 602)
+
/*------------*/
#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index d42a0ce47e8..900d4be2068 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -715,6 +715,52 @@ out:
}
static int
+validate_server_options (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
+ char *value, char **op_errstr)
+{
+ char errstr[2048] = "";
+ xlator_t *this = NULL;
+ int ret = -1;
+ int origin_val = 0;
+
+ this = THIS;
+ GF_ASSERT (this);
+
+ if (volinfo->status == GLUSTERD_STATUS_STARTED) {
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_VOL_SET_VALIDATION_INFO, "Please note that "
+ "volume %s is started. This option will only get "
+ "effected after a brick restart.", volinfo->volname);
+ }
+
+ ret = gf_string2int (value, &origin_val);
+ if (ret) {
+ snprintf (errstr, sizeof (errstr), "%s is not a compatible "
+ "value. %s expects an integer value.", value, key);
+ ret = -1;
+ goto out;
+ }
+
+ if (origin_val < 0) {
+ snprintf (errstr, sizeof (errstr), "%s is not a "
+ "compatible value. %s expects a positive"
+ "integer value.", value, key);
+ ret = -1;
+ goto out;
+ }
+
+ ret = 0;
+out:
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ GD_MSG_INCOMPATIBLE_VALUE, "%s", errstr);
+ *op_errstr = gf_strdup (errstr);
+ }
+
+ return ret;
+}
+
+static int
validate_stripe (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
char *value, char **op_errstr)
{
@@ -1969,6 +2015,16 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.op_version = GD_OP_VERSION_3_10_2,
.value = "9",
},
+ { .key = "transport.listen-backlog",
+ .voltype = "protocol/server",
+ .option = "transport.listen-backlog",
+ .op_version = GD_OP_VERSION_3_11_1,
+ .validate_fn = validate_server_options,
+ .description = "This option uses the value of backlog argument that "
+ "defines the maximum length to which the queue of "
+ "pending connections for socket fd may grow.",
+ .value = "10",
+ },
/* Generic transport options */
{ .key = SSL_OWN_CERT_OPT,
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 789bc6e9ed1..14c1c6ae942 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -462,14 +462,12 @@ glusterd_rpcsvc_options_build (dict_t *options)
int ret = 0;
uint32_t backlog = 0;
- ret = dict_get_uint32 (options, "transport.socket.listen-backlog",
- &backlog);
+ ret = dict_get_uint32 (options, "transport.listen-backlog", &backlog);
if (ret) {
- backlog = GLUSTERD_SOCKET_LISTEN_BACKLOG;
+ backlog = GLUSTERFS_SOCKET_LISTEN_BACKLOG;
ret = dict_set_uint32 (options,
- "transport.socket.listen-backlog",
- backlog);
+ "transport.listen-backlog", backlog);
if (ret)
goto out;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 1f7f47e443f..9546a389900 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -40,7 +40,6 @@
#include "events.h"
#define GLUSTERD_TR_LOG_SIZE 50
-#define GLUSTERD_SOCKET_LISTEN_BACKLOG 128
#define GLUSTERD_QUORUM_TYPE_KEY "cluster.server-quorum-type"
#define GLUSTERD_QUORUM_RATIO_KEY "cluster.server-quorum-ratio"
#define GLUSTERD_GLOBAL_OPT_VERSION "global-option-version"