diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-05-15 11:50:53 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-05-27 23:59:52 -0700 |
commit | bb02cfb56ae08f56df4452c2b948fa962ae1212b (patch) | |
tree | 6aabaa62e44684173e6436c6d21c56f65655f4c9 /xlators/cluster/afr | |
parent | 38b2531d91e51dc73ba99ebcd3b98db75affa7d7 (diff) |
cluster/afr: Don't support heal info healed/heal-failed commands
Change-Id: Iecfd3150e4f4e795e3403bcb1ac56340759a37d0
BUG: 1098027
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/7766
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heald.c | 51 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heald.h | 2 |
2 files changed, 21 insertions, 32 deletions
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); diff --git a/xlators/cluster/afr/src/afr-self-heald.h b/xlators/cluster/afr/src/afr-self-heald.h index 10e229ee7c2..59f06b79cff 100644 --- a/xlators/cluster/afr/src/afr-self-heald.h +++ b/xlators/cluster/afr/src/afr-self-heald.h @@ -53,8 +53,6 @@ typedef struct { struct subvol_healer *index_healers; struct subvol_healer *full_healers; - eh_t *healed; - eh_t *heal_failed; eh_t *split_brain; eh_t **statistics; } afr_self_heald_t; |