From bb02cfb56ae08f56df4452c2b948fa962ae1212b Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 15 May 2014 11:50:53 +0530 Subject: cluster/afr: Don't support heal info healed/heal-failed commands Change-Id: Iecfd3150e4f4e795e3403bcb1ac56340759a37d0 BUG: 1098027 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/7766 Tested-by: Gluster Build System Reviewed-by: Ravishankar N Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr-self-heald.c | 51 +++++++++++++------------------- 1 file changed, 21 insertions(+), 30 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heald.c') diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c index 0ff4c0cb1fc..25ae530913d 100644 --- a/xlators/cluster/afr/src/afr-self-heald.c +++ b/xlators/cluster/afr/src/afr-self-heald.c @@ -20,8 +20,6 @@ #include "protocol-common.h" #define SHD_INODE_LRU_LIMIT 2048 -#define AFR_EH_HEALED_LIMIT 1024 -#define AFR_EH_HEAL_FAIL_LIMIT 1024 #define AFR_EH_SPLIT_BRAIN_LIMIT 1024 #define AFR_STATISTICS_HISTORY_SIZE 50 @@ -314,30 +312,29 @@ afr_shd_selfheal (struct subvol_healer *healer, int child, uuid_t gfid) eh = shd->split_brain; crawl_event->split_brain_count++; } else if (ret < 0) { - eh = shd->heal_failed; crawl_event->heal_failed_count++; } else if (ret == 0) { - eh = shd->healed; crawl_event->healed_count++; } if (eh) { shd_event = GF_CALLOC (1, sizeof(*shd_event), gf_afr_mt_shd_event_t); - if (!shd_event) { - GF_FREE (path); - return ret; - } + if (!shd_event) + goto out; shd_event->child = child; shd_event->path = path; - if (eh_save_history (eh, shd_event) < 0) { - GF_FREE (shd_event); - GF_FREE (path); - return ret; - } + if (eh_save_history (eh, shd_event) < 0) + goto out; + + shd_event = NULL; + path = NULL; } +out: + GF_FREE (shd_event); + GF_FREE (path); return ret; } @@ -1055,16 +1052,6 @@ afr_selfheal_daemon_init (xlator_t *this) goto out; } - shd->healed = eh_new (AFR_EH_HEALED_LIMIT, _gf_false, - afr_destroy_shd_event_data); - if (!shd->healed) - goto out; - - shd->heal_failed = eh_new (AFR_EH_HEAL_FAIL_LIMIT, _gf_false, - afr_destroy_shd_event_data); - if (!shd->heal_failed) - goto out; - shd->split_brain = eh_new (AFR_EH_SPLIT_BRAIN_LIMIT, _gf_false, afr_destroy_shd_event_data); if (!shd->split_brain) @@ -1168,7 +1155,7 @@ afr_xl_op (xlator_t *this, dict_t *input, dict_t *output) for (i = 0; i < priv->child_count; i++) { healer = &shd->index_healers[i]; - snprintf (key, 64, "%d-%d-status", xl_id, i); + snprintf (key, sizeof (key), "%d-%d-status", xl_id, i); if (!priv->child_up[i]) { ret = dict_set_str (output, key, @@ -1193,7 +1180,7 @@ afr_xl_op (xlator_t *this, dict_t *input, dict_t *output) for (i = 0; i < priv->child_count; i++) { healer = &shd->full_healers[i]; - snprintf (key, 64, "%d-%d-status", xl_id, i); + snprintf (key, sizeof (key), "%d-%d-status", xl_id, i); if (!priv->child_up[i]) { ret = dict_set_str (output, key, @@ -1219,10 +1206,12 @@ afr_xl_op (xlator_t *this, dict_t *input, dict_t *output) afr_shd_gather_index_entries (this, i, output); break; case GF_AFR_OP_HEALED_FILES: - eh_dump (shd->healed, output, afr_add_shd_event); - break; case GF_AFR_OP_HEAL_FAILED_FILES: - eh_dump (shd->heal_failed, output, afr_add_shd_event); + for (i = 0; i < priv->child_count; i++) { + snprintf (key, sizeof (key), "%d-%d-status", xl_id, i); + ret = dict_set_str (output, key, "Operation Not " + "Supported"); + } break; case GF_AFR_OP_SPLIT_BRAIN_FILES: eh_dump (shd->split_brain, output, afr_add_shd_event); @@ -1243,11 +1232,13 @@ afr_xl_op (xlator_t *this, dict_t *input, dict_t *output) for (i = 0; i < priv->child_count; i++) { if (!priv->child_up[i]) { - snprintf (key, 64, "%d-%d-status", xl_id, i); + snprintf (key, sizeof (key), "%d-%d-status", + xl_id, i); ret = dict_set_str (output, key, "Brick is not connected"); } else { - snprintf (key, 64, "%d-%d-hardlinks", xl_id, i); + snprintf (key, sizeof (key), "%d-%d-hardlinks", + xl_id, i); cnt = afr_shd_get_index_count (this, i); if (cnt >= 0) { ret = dict_set_uint64 (output, key, cnt); -- cgit