From 8909c28c1173e10fd2f10706bd8a0f2ca5b5d685 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Wed, 27 Mar 2013 19:55:58 -0700 Subject: cluster/afr: fsync() guarantees POST-OP completion AFR now provides a stronger guarantee that fsync() returns only after completely finishing all the deferred/delayed POST-OP on that open file. To acheive this we make a stub out of the returning fsync and register it with the "delayed" frame in afr_changelog_wake_resume(). The delayed frame, after getting woken up and finishing the POST-OP will call_resume() the registered stub (which UNWINDs the fsync) at the time of frame destruction. This provides a guarantee that an application's (or FUSE) fsync() returns only after finishing up all the previous transactions, including delayed POST-OPs and UNLOCK. Change-Id: Iaa955457e2f25088a144fde37ad0444277b5cf49 BUG: 927146 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/4737 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr.h | 7 +++++++ 1 file changed, 7 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 5d9f752b9..878dbd7ba 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -673,6 +673,10 @@ typedef struct _afr_local { */ int *postop_piggybacked; + /* stub to resume on destruction + of the transaction frame */ + call_stub_t *resume_stub; + int32_t **txn_changelog;//changelog after pre+post ops unsigned char *pre_op; @@ -1102,4 +1106,7 @@ afr_fd_report_unstable_write (xlator_t *this, fd_t *fd); gf_boolean_t afr_fd_has_witnessed_unstable_write (xlator_t *this, fd_t *fd); +void +afr_delayed_changelog_wake_resume (xlator_t *this, fd_t *fd, call_stub_t *stub); + #endif /* __AFR_H__ */ -- cgit