summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-01-28 12:49:39 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-01-28 12:49:39 +0000
commit738e76f0799fa598eac308144174c6cf9db21b7a (patch)
tree0cb787d50ff0753b81cd3b0913476c27adbe4686 /xlators/mgmt
parent007182f1aad9d14e8d5bc7771d500b35026f0afa (diff)
parent6dfe01d7e726675913e98dc65c6c7406e5060e15 (diff)
Merge branch 'upstream'
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c18
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quota.c19
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c28
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c8
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c51
6 files changed, 68 insertions, 60 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 06ee849f5..963aa0762 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1094,8 +1094,7 @@ glusterd_op_stage_stats_volume (dict_t *dict, char **op_errstr)
}
if ((GF_CLI_STATS_STOP == stats_op) ||
- (GF_CLI_STATS_INFO <= stats_op &&
- stats_op <= GF_CLI_STATS_INFO_CUMULATIVE)) {
+ (GF_CLI_STATS_INFO == stats_op)) {
if (_gf_false == glusterd_is_profile_on (volinfo)) {
snprintf (msg, sizeof (msg), "Profile on Volume %s is"
" not started", volinfo->volname);
@@ -1105,8 +1104,7 @@ glusterd_op_stage_stats_volume (dict_t *dict, char **op_errstr)
}
}
if ((GF_CLI_STATS_TOP == stats_op) ||
- (GF_CLI_STATS_INFO <= stats_op &&
- stats_op <= GF_CLI_STATS_INFO_CUMULATIVE)) {
+ (GF_CLI_STATS_INFO == stats_op)) {
if (_gf_false == glusterd_is_volume_started (volinfo)) {
snprintf (msg, sizeof (msg), "Volume %s is not started.",
volinfo->volname);
@@ -1541,10 +1539,12 @@ glusterd_op_set_volume (dict_t *dict)
if (dict_count == 0) {
ret = glusterd_volset_help (NULL, &op_errstr);
if (ret) {
- op_errstr = (op_errstr)? op_errstr:
- "Volume set help internal error";
- gf_log (this->name, GF_LOG_ERROR, "%s", op_errstr);
+ gf_log (this->name, GF_LOG_ERROR, "%s",
+ (op_errstr)? op_errstr:
+ "Volume set help internal error");
}
+
+ GF_FREE(op_errstr);
goto out;
}
@@ -1908,8 +1908,6 @@ glusterd_op_stats_volume (dict_t *dict, char **op_errstr,
glusterd_remove_profile_volume_options (volinfo);
break;
case GF_CLI_STATS_INFO:
- case GF_CLI_STATS_INFO_INCREMENTAL:
- case GF_CLI_STATS_INFO_CUMULATIVE:
case GF_CLI_STATS_TOP:
//info is already collected in brick op.
//just goto out;
@@ -4480,8 +4478,6 @@ glusterd_bricks_select_profile_volume (dict_t *dict, char **op_errstr,
goto out;
break;
case GF_CLI_STATS_INFO:
- case GF_CLI_STATS_INFO_INCREMENTAL:
- case GF_CLI_STATS_INFO_CUMULATIVE:
ret = dict_get_str_boolean (dict, "nfs", _gf_false);
if (ret) {
if (!glusterd_is_nodesvc_online ("nfs")) {
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c
index ffde532bd..d13533aa6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quota.c
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.c
@@ -996,14 +996,6 @@ glusterd_quotad_op (int opcode)
ret = glusterd_check_generate_start_quotad ();
break;
- case GF_QUOTA_OPTION_TYPE_DEFAULT_SOFT_LIMIT:
- case GF_QUOTA_OPTION_TYPE_HARD_TIMEOUT:
- case GF_QUOTA_OPTION_TYPE_SOFT_TIMEOUT:
- case GF_QUOTA_OPTION_TYPE_ALERT_TIME:
-
- ret = glusterd_reconfigure_quotad ();
- break;
-
default:
ret = 0;
break;
@@ -1131,6 +1123,12 @@ glusterd_op_quota (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
goto out;
}
+ if (priv->op_version > GD_OP_VERSION_MIN) {
+ ret = glusterd_quotad_op (type);
+ if (ret)
+ goto out;
+ }
+
ret = glusterd_create_volfiles_and_notify_services (volinfo);
if (ret) {
gf_log (this->name, GF_LOG_ERROR, "Unable to re-create "
@@ -1151,11 +1149,6 @@ glusterd_op_quota (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
if (rsp_dict && start_crawl == _gf_true)
glusterd_quota_initiate_fs_crawl (priv, volname, type);
- if (priv->op_version > GD_OP_VERSION_MIN) {
- ret = glusterd_quotad_op (type);
- if (ret)
- goto out;
- }
ret = 0;
out:
return ret;
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index d0ad7dcdb..2c2fc6fb4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -2582,8 +2582,10 @@ glusterd_store_retrieve_peers (xlator_t *this)
ret = gf_store_iter_get_next (iter, &key, &value,
&op_errno);
}
- if (op_errno != GD_STORE_EOF)
+ if (op_errno != GD_STORE_EOF) {
+ GF_FREE(hostname);
goto out;
+ }
(void) gf_store_iter_destroy (iter);
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index fc4018190..21a973086 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1295,11 +1295,14 @@ glusterd_brick_connect (glusterd_volinfo_t *volinfo,
glusterd_brick_rpc_notify,
brickid);
synclock_lock (&priv->big_lock);
- if (ret)
+ if (ret) {
+ GF_FREE (brickid);
goto out;
+ }
brickinfo->rpc = rpc;
}
out:
+
gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
}
@@ -3965,7 +3968,7 @@ glusterd_nodesvc_disconnect (char *server)
}
int32_t
-glusterd_nodesvc_start (char *server)
+glusterd_nodesvc_start (char *server, gf_boolean_t wait)
{
int32_t ret = -1;
xlator_t *this = NULL;
@@ -4051,7 +4054,16 @@ glusterd_nodesvc_start (char *server)
runner_log (&runner, "", GF_LOG_DEBUG,
"Starting the nfs/glustershd services");
- ret = runner_run_nowait (&runner);
+ if (!wait) {
+ ret = runner_run_nowait (&runner);
+ } else {
+ synclock_unlock (&priv->big_lock);
+ {
+ ret = runner_run (&runner);
+ }
+ synclock_lock (&priv->big_lock);
+ }
+
if (ret == 0) {
glusterd_nodesvc_connect (server, sockfpath);
}
@@ -4062,19 +4074,19 @@ out:
int
glusterd_nfs_server_start ()
{
- return glusterd_nodesvc_start ("nfs");
+ return glusterd_nodesvc_start ("nfs", _gf_false);
}
int
glusterd_shd_start ()
{
- return glusterd_nodesvc_start ("glustershd");
+ return glusterd_nodesvc_start ("glustershd", _gf_false);
}
int
glusterd_quotad_start ()
{
- return glusterd_nodesvc_start ("quotad");
+ return glusterd_nodesvc_start ("quotad", _gf_true);
}
gf_boolean_t
@@ -4805,8 +4817,8 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
uuid_str, NULL);
out:
- if (path_list)
- GF_FREE (path_list);
+ GF_FREE (path_list);
+ GF_FREE (op_errstr);
return ret;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index a94a47af3..303abd1bc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1974,13 +1974,13 @@ server_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
}
/* Check for compress volume option, and add it to the graph on server side */
- if (dict_get_str_boolean (set_dict, "features.compress", 0)) {
+ if (dict_get_str_boolean (set_dict, "network.compression", 0)) {
xl = volgen_graph_add (graph, "features/cdc", volname);
if (!xl) {
ret = -1;
goto out;
}
- ret = dict_set_str (set_dict, "compress.mode", "server");
+ ret = dict_set_str (set_dict, "network.compression.mode", "server");
if (ret)
goto out;
}
@@ -2852,13 +2852,13 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
goto out;
/* Check for compress volume option, and add it to the graph on client side */
- if (dict_get_str_boolean (set_dict, "features.compress", 0)) {
+ if (dict_get_str_boolean (set_dict, "network.compression", 0)) {
xl = volgen_graph_add (graph, "features/cdc", volname);
if (!xl) {
ret = -1;
goto out;
}
- ret = dict_set_str (set_dict, "compress.mode", "client");
+ ret = dict_set_str (set_dict, "network.compression.mode", "client");
if (ret)
goto out;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 520b0f774..8d29e8edc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -1023,47 +1023,52 @@ struct volopt_map_entry glusterd_volopt_map[] = {
#ifdef HAVE_LIB_Z
/* Compressor-decompressor xlator options
- * defaults used from xlator/feature/compress/src/cdc.h
+ * defaults used from xlator/features/compress/src/cdc.h
*/
- { .key = "features.compress",
+ { .key = "network.compression",
.voltype = "features/cdc",
- .option = "!compress",
.value = "off",
.type = NO_DOC,
- .op_version = 2,
- .description = "enable/disable compression translator"
+ .op_version = 3,
+ .description = "enable/disable network compression translator"
},
- { .key = "compress.mode",
+ { .key = "network.compression.mode",
.voltype = "features/cdc",
+ .option = "mode",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
- { .key = "compress.window-size",
+ { .key = "network.compression.window-size",
.voltype = "features/cdc",
+ .option = "window-size",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
- { .key = "compress.mem-level",
+ { .key = "network.compression.mem-level",
.voltype = "features/cdc",
+ .option = "mem-level",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
- { .key = "compress.min-size",
+ { .key = "network.compression.min-size",
.voltype = "features/cdc",
+ .option = "min-size",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
- { .key = "compress.compression-level",
+ { .key = "network.compression.compression-level",
.voltype = "features/cdc",
+ .option = "compression-level",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
- { .key = "compress.debug",
+ { .key = "network.compression.debug",
.voltype = "features/cdc",
+ .option = "debug",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
- #endif
+#endif
/* Quota xlator options */
{ .key = VKEY_FEATURES_LIMIT_USAGE,
@@ -1470,27 +1475,27 @@ struct volopt_map_entry glusterd_volopt_map[] = {
{ .key = "changelog.changelog",
.voltype = "features/changelog",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
{ .key = "changelog.changelog-dir",
.voltype = "features/changelog",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
{ .key = "changelog.encoding",
.voltype = "features/changelog",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
{ .key = "changelog.rollover-time",
.voltype = "features/changelog",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
{ .key = "changelog.fsync-interval",
.voltype = "features/changelog",
.type = NO_DOC,
- .op_version = 2
+ .op_version = 3
},
{ .key = NULL
}