summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-04-18 17:30:39 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-07 00:51:40 -0700
commitc4dadc74fd1d1188f123eae7f2b6d6f5232e2a0f (patch)
tree5ca66ff4466a58d7038d7fbdf8587847a4c85645 /xlators/cluster
parentca5861fdf9fdf9c29523893418312bdf1796c28e (diff)
Self-heald: Dump the event history completely
Change-Id: Icf08ef1752795276f88c343d1d74af104095c6cb BUG: 796579 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3276 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-common.c1
-rw-r--r--xlators/cluster/afr/src/afr-self-heald.c21
-rw-r--r--xlators/cluster/afr/src/afr.c6
-rw-r--r--xlators/cluster/afr/src/afr.h1
4 files changed, 5 insertions, 24 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index bf4c0fb17fb..980114e0d7c 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -4109,7 +4109,6 @@ afr_priv_destroy (afr_private_t *priv)
GF_FREE (priv->shd.pos);
GF_FREE (priv->shd.pending);
GF_FREE (priv->shd.inprogress);
- GF_FREE (priv->shd.sh_times);
// for (i = 0; i < priv->child_count; i++)
// if (priv->shd.timer && priv->shd.timer[i])
// gf_timer_call_cancel (this->ctx, priv->shd.timer[i]);
diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c
index 617711d0de9..7db733fcd49 100644
--- a/xlators/cluster/afr/src/afr-self-heald.c
+++ b/xlators/cluster/afr/src/afr-self-heald.c
@@ -41,7 +41,6 @@ typedef enum {
typedef struct shd_dump {
dict_t *dict;
- time_t sh_time;
xlator_t *this;
int child;
} shd_dump_t;
@@ -219,23 +218,20 @@ _add_event_to_dict (circular_buffer_t *cb, void *data)
shd_event = cb->data;
if (shd_event->child != dump_data->child)
goto out;
- if (cb->tv.tv_sec >= dump_data->sh_time)
- ret = _add_str_to_dict (dump_data->this, dump_data->dict,
- dump_data->child, shd_event->path,
- _gf_false);
+ ret = _add_str_to_dict (dump_data->this, dump_data->dict,
+ dump_data->child, shd_event->path,
+ _gf_false);
out:
return ret;
}
int
-_add_eh_to_dict (xlator_t *this, eh_t *eh, dict_t *dict, time_t sh_time,
- int child)
+_add_eh_to_dict (xlator_t *this, eh_t *eh, dict_t *dict, int child)
{
shd_dump_t dump_data = {0};
dump_data.this = this;
dump_data.dict = dict;
- dump_data.sh_time = sh_time;
dump_data.child = child;
eh_dump (eh, &dump_data, _add_event_to_dict);
return 0;
@@ -385,13 +381,6 @@ afr_crawl_done (int ret, call_frame_t *sync_frame, void *data)
void
_do_self_heal_on_subvol (xlator_t *this, int child, afr_crawl_type_t crawl)
{
- afr_private_t *priv = NULL;
- afr_self_heald_t *shd = NULL;
-
- priv = this->private;
- shd = &priv->shd;
-
- time (&shd->sh_times[child]);
afr_start_crawl (this, child, crawl, _self_heal_entry,
NULL, _gf_true, STOP_CRAWL_ON_SINGLE_SUBVOL,
afr_crawl_done);
@@ -525,7 +514,7 @@ _add_all_subvols_eh_to_dict (xlator_t *this, eh_t *eh, dict_t *dict)
for (i = 0; i < priv->child_count; i++) {
if (shd->pos[i] != AFR_POS_LOCAL)
continue;
- _add_eh_to_dict (this, eh, dict, shd->sh_times[i], i);
+ _add_eh_to_dict (this, eh, dict, i);
}
return 0;
}
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index f6db7b9e948..ed5bbb81981 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -406,12 +406,6 @@ init (xlator_t *this)
if (!priv->shd.split_brain)
goto out;
- priv->shd.sh_times = GF_CALLOC (priv->child_count,
- sizeof (*priv->shd.sh_times),
- gf_afr_mt_time_t);
- if (!priv->shd.sh_times)
- goto out;
-
this->itable = inode_table_new (SHD_INODE_LRU_LIMIT, this);
if (!this->itable)
goto out;
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 2cd29f1c51e..765f1fd7764 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -100,7 +100,6 @@ typedef struct afr_self_heald_ {
afr_crawl_type_t *pending;
gf_boolean_t *inprogress;
afr_child_pos_t *pos;
- time_t *sh_times;
gf_timer_t **timer;
eh_t *healed;
eh_t *heal_failed;