diff options
author | Pranith K <pranithk@gluster.com> | 2011-07-14 06:31:08 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-07-17 07:45:29 -0700 |
commit | 5dff9a2938c199285662bb5b33d7e3aeda0e3fb6 (patch) | |
tree | 20af21a206a8ed7937101005cbb4b9128b5c48fd /xlators/cluster/afr/src/afr-self-heal-metadata.c | |
parent | 84c3d7a83a8c84ca11514202a1bc365026fd1c87 (diff) |
cluster/afr: Fix conflict files and gfid self-heal
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2745 (failure to detect split brain)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2745
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-metadata.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-metadata.c | 74 |
1 files changed, 6 insertions, 68 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 5993e9596ba..04c5ef4e11b 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -492,16 +492,10 @@ afr_sh_metadata_fix (call_frame_t *frame, xlator_t *this) sh = &local->self_heal; priv = this->private; - afr_build_pending_matrix (priv->pending_key, sh->pending_matrix, - sh->xattr, AFR_METADATA_TRANSACTION, - priv->child_count); - - afr_sh_print_pending_matrix (sh->pending_matrix, this); - - nsources = afr_mark_sources (sh->sources, sh->pending_matrix, sh->buf, - priv->child_count, AFR_SELF_HEAL_METADATA, - sh->success_children, this->name); - + nsources = afr_build_sources (this, sh->xattr, sh->buf, + sh->pending_matrix, sh->sources, + sh->success_children, + AFR_METADATA_TRANSACTION); if (nsources == 0) { gf_log (this->name, GF_LOG_TRACE, "No self-heal needed for %s", @@ -631,63 +625,6 @@ afr_sh_metadata_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, return 0; } - -int -afr_sh_metadata_lookup (call_frame_t *frame, xlator_t *this) -{ - afr_local_t *local = NULL; - afr_private_t *priv = NULL; - int i = 0; - int call_count = 0; - dict_t *xattr_req = NULL; - int ret = 0; - afr_self_heal_t *sh = NULL; - - local = frame->local; - priv = this->private; - sh = &local->self_heal; - - call_count = afr_up_children_count (priv->child_count, - local->child_up); - local->call_count = call_count; - - xattr_req = dict_new(); - - if (xattr_req) { - for (i = 0; i < priv->child_count; i++) { - ret = dict_set_uint64 (xattr_req, - priv->pending_key[i], - 3 * sizeof(int32_t)); - if (ret < 0) - gf_log (this->name, GF_LOG_WARNING, - "Unable to set dict value."); - } - } - - afr_reset_children (sh->success_children, priv->child_count); - sh->success_count = 0; - for (i = 0; i < priv->child_count; i++) { - if (local->child_up[i]) { - gf_log (this->name, GF_LOG_TRACE, - "looking up %s on %s", - local->loc.path, priv->children[i]->name); - - STACK_WIND_COOKIE (frame, afr_sh_metadata_lookup_cbk, - (void *) (long) i, - priv->children[i], - priv->children[i]->fops->lookup, - &local->loc, xattr_req); - if (!--call_count) - break; - } - } - - if (xattr_req) - dict_unref (xattr_req); - - return 0; -} - int afr_sh_metadata_post_nonblocking_inodelk_cbk (call_frame_t *frame, xlator_t *this) @@ -709,7 +646,8 @@ afr_sh_metadata_post_nonblocking_inodelk_cbk (call_frame_t *frame, gf_log (this->name, GF_LOG_DEBUG, "Non Blocking metadata " "inodelks done for %s. Proceeding to FOP", local->loc.path); - afr_sh_metadata_lookup (frame, this); + afr_sh_common_lookup (frame, this, &local->loc, + afr_sh_metadata_lookup_cbk, _gf_false); } return 0; |