From 03591027b06c556baa95c6fa4569be0bff4adcd8 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 20 Sep 2011 18:30:42 +0530 Subject: cluster/afr: Make local->child_up immutable Afr transaction performs lock, pre-op, op, post-op and unlock steps in that order. The child_up[] is overloaded with the information of where all the first two steps succeeded. This works perfectly fine for Transaction, but the locking/unlocking part of the code is re-used by data self-heal. In that each loop_frame does lock, rchecksum, read-from-source and write-to-sinks, unlock steps. Rchecksum fop assumes that the fop needs to happen on one source + all sinks and sets the call_count to that number. But if the lock step fails on any of the sinks it will mark the child_up of that child to 0, which will result in call_count mismatch and the frame will hang thinking that some more cbks need to come. When this happens loop_frame will never go to unlock step leading to hangs on that file. Change-Id: I3dd0449cc6193a980bacf637d935881f4b22210a BUG: 3597 Reviewed-on: http://review.gluster.com/474 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/afr/src/afr.h') diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 92ccf607f10..becbd261f57 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -377,7 +377,7 @@ typedef struct _afr_local { loc_t newloc; fd_t *fd; - int32_t *fd_open_on; + unsigned char *fd_open_on; glusterfs_fop_t fop; @@ -682,6 +682,7 @@ typedef struct _afr_local { int last_tried; int32_t *child_errno; + unsigned char *pre_op; call_frame_t *main_frame; @@ -826,6 +827,10 @@ afr_up_children_count (unsigned char *child_up, unsigned int child_count); unsigned int afr_locked_children_count (unsigned char *children, unsigned int child_count); +unsigned int +afr_pre_op_done_children_count (unsigned char *pre_op, + unsigned int child_count); + gf_boolean_t afr_is_fresh_lookup (loc_t *loc, xlator_t *this); -- cgit