diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-12-29 15:32:28 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-01-20 02:24:24 -0800 |
commit | 7510d8edf4e7bea50e0c1f041202f063a5d138af (patch) | |
tree | 77814773e915cedccbcb9149ff8c86ca704514fa /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 1ee8ce725f0e70f45419aa0e2f4d85db7223d766 (diff) |
mgmt/glusterd: Implement Volume heal enable/disable
For volumes with replicate, disperse xlators, self-heal daemon should do
healing. This patch provides enable/disable functionality for the xlators to be
part of self-heal-daemon. Replicate already had this functionality with
'gluster volume set cluster.self-heal-daemon on/off'. But this patch makes it
uniform for both types of volumes. Internally it still does 'volume set' based
on the volume type.
Change-Id: Ie0f3799b74c2afef9ac658ef3d50dce3e8072b29
BUG: 1177601
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9358
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 5ff09d5a4ce..d829676228c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -4964,7 +4964,7 @@ glusterd_nodesvcs_batch_op (glusterd_volinfo_t *volinfo, int (*nfs_op) (), if (ret) goto out; - if (volinfo && !glusterd_is_volume_replicate (volinfo)) { + if (volinfo && !glusterd_is_shd_compatible_volume (volinfo)) { ; //do nothing } else { ret = shd_op (); @@ -5026,7 +5026,7 @@ glusterd_are_all_volumes_stopped () } gf_boolean_t -glusterd_all_replicate_volumes_stopped () +glusterd_all_shd_compatible_volumes_stopped () { glusterd_conf_t *priv = NULL; xlator_t *this = NULL; @@ -5038,7 +5038,7 @@ glusterd_all_replicate_volumes_stopped () GF_ASSERT (priv); list_for_each_entry (voliter, &priv->volumes, vol_list) { - if (!glusterd_is_volume_replicate (voliter)) + if (!glusterd_is_shd_compatible_volume (voliter)) continue; if (voliter->status == GLUSTERD_STATUS_STARTED) return _gf_false; @@ -5088,7 +5088,7 @@ glusterd_nodesvcs_handle_graph_change (glusterd_volinfo_t *volinfo) nfs_op = glusterd_nfs_server_stop; qd_op = glusterd_quotad_stop; } else { - if (glusterd_all_replicate_volumes_stopped()) { + if (glusterd_all_shd_compatible_volumes_stopped()) { shd_op = glusterd_shd_stop; } if (glusterd_all_volumes_with_quota_stopped ()) { @@ -6997,6 +6997,19 @@ glusterd_is_volume_replicate (glusterd_volinfo_t *volinfo) return replicates; } +gf_boolean_t +glusterd_is_shd_compatible_volume (glusterd_volinfo_t *volinfo) +{ + switch (volinfo->type) { + case GF_CLUSTER_TYPE_REPLICATE: + case GF_CLUSTER_TYPE_STRIPE_REPLICATE: + case GF_CLUSTER_TYPE_DISPERSE: + return _gf_true; + + } + return _gf_false; +} + int glusterd_set_dump_options (char *dumpoptions_path, char *options, int option_cnt) |