From 9ab2747da78061882f6734df4b265bce11adaef1 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Tue, 9 Apr 2019 09:44:33 +0530 Subject: afr: thin-arbiter lock release fixes - pass fop state instead of afr local to afr_ta_dom_lock_check_and_release() - avoid afr_lock_release_synctask() being called simultaneosuly from notify code path and transaction (post-op) code path due to races. - Check if the post-op on TA is valid based on event_gen checks. - Invalidate in-memory information when we get TA child down. Note: Thi patch addresses some pending review comments of commit 053b1309dc8fbc05fcde5223e734da9f694cf5cc (https://review.gluster.org/#/c/glusterfs/+/20095/) fixes: bz#1698449 Change-Id: I2ccd7e1b53362f9f3fed8680aecb23b5011eb18c Signed-off-by: Ravishankar N --- xlators/cluster/afr/src/afr.h | 6 ++++++ 1 file changed, 6 insertions(+) (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 33e78c15c6c..1a409ec625b 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -126,6 +126,7 @@ typedef enum { *on BAD brick - Success*/ TA_INFO_IN_MEMORY_FAILED, /*Bad brick info is in memory and fop failed *on GOOD brick - Failed*/ + TA_SUCCESS, /*FOP succeeded on both data bricks.*/ } afr_ta_fop_state_t; struct afr_nfsd { @@ -148,6 +149,7 @@ typedef struct _afr_private { uuid_t ta_gfid; unsigned char ta_child_up; int ta_bad_child_index; + int ta_event_gen; off_t ta_notify_dom_lock_offset; gf_boolean_t release_ta_notify_dom_lock; unsigned int ta_in_mem_txn_count; @@ -884,6 +886,7 @@ typedef struct _afr_local { struct list_head ta_onwireq; afr_ta_fop_state_t fop_state; int ta_failed_subvol; + int ta_event_gen; gf_boolean_t is_new_entry; } afr_local_t; @@ -1323,6 +1326,9 @@ afr_ta_has_quorum(afr_private_t *priv, afr_local_t *local); void afr_ta_lock_release_synctask(xlator_t *this); +void +afr_ta_locked_priv_invalidate(afr_private_t *priv); + gf_boolean_t afr_lookup_has_quorum(call_frame_t *frame, xlator_t *this, unsigned char *subvols); -- cgit