From 7510d8edf4e7bea50e0c1f041202f063a5d138af Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 29 Dec 2014 15:32:28 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/9358 Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System Reviewed-by: Xavier Hernandez Tested-by: Krishnan Parthasarathi --- tests/volume.rc | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'tests/volume.rc') diff --git a/tests/volume.rc b/tests/volume.rc index daa9c140fd8..2fd07cd8745 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -135,18 +135,15 @@ function ec_child_up_count { } function get_shd_process_pid { - local vol=$1 ps auxww | grep glusterfs | grep -E "glustershd/run/glustershd.pid" | awk '{print $2}' | head -1 } function generate_shd_statedump { - local vol=$1 - generate_statedump $(get_shd_process_pid $vol) + generate_statedump $(get_shd_process_pid) } function generate_nfs_statedump { - local vol=$1 - generate_statedump $(get_nfs_pid $vol) + generate_statedump $(get_nfs_pid) } function generate_brick_statedump { @@ -425,3 +422,26 @@ function assign_gfid { function get_random_gfid { echo "0x"$(uuidgen | awk -F '-' 'BEGIN {OFS=""} {print $1,$2,$3,$4,$5}') } + +function volgen_volume_exists { + local volfile="$1" + local xl_vol="$2" + local xl_type="$3" + local xl_feature="$4" + xl=$(sed -e "/./{H;\$!d;}" -e "x;/volume $xl_vol/!d;/type $xl_type\/$xl_feature/!d" $volfile) + if [ -z "$xl" ]; + then + echo "N" + else + echo "Y" + fi +} + +function volgen_volume_option { + local volfile="$1" + local xl_vol="$2" + local xl_type="$3" + local xl_feature="$4" + local xl_option="$5" + sed -e "/./{H;\$!d;}" -e "x;/volume $xl_vol/!d;/type $xl_type\/$xl_feature/!d;/option $xl_option/!d" $volfile | grep " $xl_option " | awk '{print $3}' +} -- cgit