|
|
cb8e9e |
From 34dac73cafee0cca75ad5b3c819a903b1d35420a Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: Ashish Pandey <aspandey@redhat.com>
|
|
|
cb8e9e |
Date: Wed, 13 May 2015 14:48:42 +0530
|
|
|
cb8e9e |
Subject: [PATCH 52/57] glusterd : Display status of Self Heal Daemon for disperse volume
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Problem : Status of Self Heal Daemon is not
|
|
|
cb8e9e |
displayed in "gluster volume status"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
As disperse volumes are self heal compatible,
|
|
|
cb8e9e |
show the status of self heal daemon in gluster
|
|
|
cb8e9e |
volume status command
|
|
|
cb8e9e |
Review link for master -
|
|
|
cb8e9e |
http://review.gluster.org/#/c/10764/
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Change-Id: I83d3e6a2fd122b171f15cfd76ce8e6b6e00f92e2
|
|
|
cb8e9e |
BUG: 1224195
|
|
|
cb8e9e |
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/50434
|
|
|
cb8e9e |
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
cb8e9e |
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
xlators/mgmt/glusterd/src/glusterd-op-sm.c | 38 ++++++++++++++++-----------
|
|
|
cb8e9e |
1 files changed, 22 insertions(+), 16 deletions(-)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
|
|
cb8e9e |
index e304cb0..877e9ac 100644
|
|
|
cb8e9e |
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
|
|
cb8e9e |
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
|
|
cb8e9e |
@@ -39,6 +39,7 @@
|
|
|
cb8e9e |
#include "glusterd-volgen.h"
|
|
|
cb8e9e |
#include "glusterd-locks.h"
|
|
|
cb8e9e |
#include "glusterd-messages.h"
|
|
|
cb8e9e |
+#include "glusterd-utils.h"
|
|
|
cb8e9e |
#include "syscall.h"
|
|
|
cb8e9e |
#include "cli1-xdr.h"
|
|
|
cb8e9e |
#include "common-utils.h"
|
|
|
cb8e9e |
@@ -50,7 +51,7 @@
|
|
|
cb8e9e |
#include "glusterd-nfs-svc.h"
|
|
|
cb8e9e |
#include "glusterd-quotad-svc.h"
|
|
|
cb8e9e |
#include "glusterd-server-quorum.h"
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
+#include "glusterd-volgen.h"
|
|
|
cb8e9e |
#include <sys/types.h>
|
|
|
cb8e9e |
#include <signal.h>
|
|
|
cb8e9e |
#include <sys/wait.h>
|
|
|
cb8e9e |
@@ -1420,13 +1421,14 @@ glusterd_op_stage_status_volume (dict_t *dict, char **op_errstr)
|
|
|
cb8e9e |
char msg[2048] = {0,};
|
|
|
cb8e9e |
char *volname = NULL;
|
|
|
cb8e9e |
char *brick = NULL;
|
|
|
cb8e9e |
+ char *shd_key = NULL;
|
|
|
cb8e9e |
xlator_t *this = NULL;
|
|
|
cb8e9e |
glusterd_conf_t *priv = NULL;
|
|
|
cb8e9e |
glusterd_brickinfo_t *brickinfo = NULL;
|
|
|
cb8e9e |
glusterd_volinfo_t *volinfo = NULL;
|
|
|
cb8e9e |
dict_t *vol_opts = NULL;
|
|
|
cb8e9e |
gf_boolean_t nfs_disabled = _gf_false;
|
|
|
cb8e9e |
- gf_boolean_t shd_enabled = _gf_true;
|
|
|
cb8e9e |
+ gf_boolean_t shd_enabled = _gf_false;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_ASSERT (dict);
|
|
|
cb8e9e |
this = THIS;
|
|
|
cb8e9e |
@@ -1498,17 +1500,18 @@ glusterd_op_stage_status_volume (dict_t *dict, char **op_errstr)
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
} else if ((cmd & GF_CLI_STATUS_SHD) != 0) {
|
|
|
cb8e9e |
- if (!glusterd_is_volume_replicate (volinfo)) {
|
|
|
cb8e9e |
+ if (glusterd_is_shd_compatible_volume (volinfo)) {
|
|
|
cb8e9e |
+ shd_key = volgen_get_shd_key(volinfo);
|
|
|
cb8e9e |
+ shd_enabled = dict_get_str_boolean (vol_opts,
|
|
|
cb8e9e |
+ shd_key,
|
|
|
cb8e9e |
+ _gf_true);
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg),
|
|
|
cb8e9e |
- "Volume %s is not of type replicate",
|
|
|
cb8e9e |
- volname);
|
|
|
cb8e9e |
+ "Volume %s is not Self-heal compatible",
|
|
|
cb8e9e |
+ volname);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
- shd_enabled = dict_get_str_boolean (vol_opts,
|
|
|
cb8e9e |
- "cluster.self-heal-daemon",
|
|
|
cb8e9e |
- _gf_true);
|
|
|
cb8e9e |
if (!shd_enabled) {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
snprintf (msg, sizeof (msg),
|
|
|
cb8e9e |
@@ -2869,13 +2872,14 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
uint32_t cmd = 0;
|
|
|
cb8e9e |
char *volname = NULL;
|
|
|
cb8e9e |
char *brick = NULL;
|
|
|
cb8e9e |
+ char *shd_key = NULL;
|
|
|
cb8e9e |
xlator_t *this = NULL;
|
|
|
cb8e9e |
glusterd_volinfo_t *volinfo = NULL;
|
|
|
cb8e9e |
glusterd_brickinfo_t *brickinfo = NULL;
|
|
|
cb8e9e |
glusterd_conf_t *priv = NULL;
|
|
|
cb8e9e |
dict_t *vol_opts = NULL;
|
|
|
cb8e9e |
gf_boolean_t nfs_disabled = _gf_false;
|
|
|
cb8e9e |
- gf_boolean_t shd_enabled = _gf_true;
|
|
|
cb8e9e |
+ gf_boolean_t shd_enabled = _gf_false;
|
|
|
cb8e9e |
gf_boolean_t origin_glusterd = _gf_false;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
this = THIS;
|
|
|
cb8e9e |
@@ -3039,12 +3043,13 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
other_count++;
|
|
|
cb8e9e |
node_count++;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
- shd_enabled = dict_get_str_boolean
|
|
|
cb8e9e |
- (vol_opts, "cluster.self-heal-daemon",
|
|
|
cb8e9e |
- _gf_true);
|
|
|
cb8e9e |
- if (glusterd_is_volume_replicate (volinfo)
|
|
|
cb8e9e |
- && shd_enabled) {
|
|
|
cb8e9e |
+ if (glusterd_is_shd_compatible_volume (volinfo)) {
|
|
|
cb8e9e |
+ shd_key = volgen_get_shd_key (volinfo);
|
|
|
cb8e9e |
+ shd_enabled = dict_get_str_boolean (vol_opts,
|
|
|
cb8e9e |
+ shd_key,
|
|
|
cb8e9e |
+ _gf_true);
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
+ if (shd_enabled) {
|
|
|
cb8e9e |
ret = glusterd_add_node_to_dict
|
|
|
cb8e9e |
(priv->shd_svc.name, rsp_dict,
|
|
|
cb8e9e |
other_index, vol_opts);
|
|
|
cb8e9e |
@@ -3054,6 +3059,7 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr,
|
|
|
cb8e9e |
node_count++;
|
|
|
cb8e9e |
other_index++;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
if (glusterd_is_volume_quota_enabled (volinfo)) {
|
|
|
cb8e9e |
ret = glusterd_add_node_to_dict
|
|
|
cb8e9e |
(priv->quotad_svc.name,
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|