diff options
author | Ashish Pandey <aspandey@redhat.com> | 2015-05-13 14:48:42 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-08-25 10:59:48 -0700 |
commit | 8914210f25a976b9a1973fbf8c2ced1b307e807f (patch) | |
tree | ab4a3689f78584d59caf7581cf4f9c5a83257be4 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | 55b44094436bc8630b6c3ff2d232e6551d40630c (diff) |
glusterd : Display status of Self Heal Daemon for disperse volume
Problem : Status of Self Heal Daemon is not
displayed in "gluster volume status"
Fix : As disperse volumes are self heal compatible,
show the status of self heal daemon in gluster
volume status command
Change-Id: I83d3e6a2fd122b171f15cfd76ce8e6b6e00f92e2
BUG: 1228216
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
Reviewed-on: http://review.gluster.org/10994
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 8bf3f4ab431..a7e810cf7c6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -39,6 +39,7 @@ #include "glusterd-volgen.h" #include "glusterd-locks.h" #include "glusterd-messages.h" +#include "glusterd-utils.h" #include "syscall.h" #include "cli1-xdr.h" #include "common-utils.h" @@ -50,7 +51,7 @@ #include "glusterd-nfs-svc.h" #include "glusterd-quotad-svc.h" #include "glusterd-server-quorum.h" - +#include "glusterd-volgen.h" #include <sys/types.h> #include <signal.h> #include <sys/wait.h> @@ -1541,13 +1542,14 @@ glusterd_op_stage_status_volume (dict_t *dict, char **op_errstr) char msg[2048] = {0,}; char *volname = NULL; char *brick = NULL; + char *shd_key = NULL; xlator_t *this = NULL; glusterd_conf_t *priv = NULL; glusterd_brickinfo_t *brickinfo = NULL; glusterd_volinfo_t *volinfo = NULL; dict_t *vol_opts = NULL; gf_boolean_t nfs_disabled = _gf_false; - gf_boolean_t shd_enabled = _gf_true; + gf_boolean_t shd_enabled = _gf_false; GF_ASSERT (dict); this = THIS; @@ -1620,17 +1622,18 @@ glusterd_op_stage_status_volume (dict_t *dict, char **op_errstr) goto out; } } else if ((cmd & GF_CLI_STATUS_SHD) != 0) { - if (!glusterd_is_volume_replicate (volinfo)) { + if (glusterd_is_shd_compatible_volume (volinfo)) { + shd_key = volgen_get_shd_key (volinfo); + shd_enabled = dict_get_str_boolean (vol_opts, + shd_key, + _gf_true); + } else { ret = -1; snprintf (msg, sizeof (msg), - "Volume %s is not of type replicate", - volname); + "Volume %s is not Self-heal compatible", + volname); goto out; } - - shd_enabled = dict_get_str_boolean (vol_opts, - "cluster.self-heal-daemon", - _gf_true); if (!shd_enabled) { ret = -1; snprintf (msg, sizeof (msg), @@ -3065,13 +3068,14 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr, uint32_t cmd = 0; char *volname = NULL; char *brick = NULL; + char *shd_key = NULL; xlator_t *this = NULL; glusterd_volinfo_t *volinfo = NULL; glusterd_brickinfo_t *brickinfo = NULL; glusterd_conf_t *priv = NULL; dict_t *vol_opts = NULL; gf_boolean_t nfs_disabled = _gf_false; - gf_boolean_t shd_enabled = _gf_true; + gf_boolean_t shd_enabled = _gf_false; gf_boolean_t origin_glusterd = _gf_false; this = THIS; @@ -3237,12 +3241,13 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr, other_count++; node_count++; } - - shd_enabled = dict_get_str_boolean - (vol_opts, "cluster.self-heal-daemon", - _gf_true); - if (glusterd_is_volume_replicate (volinfo) - && shd_enabled) { + if (glusterd_is_shd_compatible_volume (volinfo)) { + shd_key = volgen_get_shd_key (volinfo); + shd_enabled = dict_get_str_boolean (vol_opts, + shd_key, + _gf_true); + } + if (shd_enabled) { ret = glusterd_add_node_to_dict (priv->shd_svc.name, rsp_dict, other_index, vol_opts); @@ -3252,6 +3257,7 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr, node_count++; other_index++; } + if (glusterd_is_volume_quota_enabled (volinfo)) { ret = glusterd_add_node_to_dict (priv->quotad_svc.name, |