diff options
author | Ravishankar N <ravishankar@redhat.com> | 2019-04-09 09:44:33 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2019-05-10 12:11:22 +0000 |
commit | 9ab2747da78061882f6734df4b265bce11adaef1 (patch) | |
tree | 5e9fd35f2d2f1afc88614d865b214acb58b28550 /xlators/cluster/afr/src/afr.h | |
parent | 13d09055f7b266a934960f8db9572ec8fd2f6dfa (diff) |
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 <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 6 |
1 files changed, 6 insertions, 0 deletions
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); |