diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2013-06-28 16:03:52 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-07-03 07:33:13 -0700 |
commit | b64a7f8497d9752f4da5a42aeeeebbd7727c442b (patch) | |
tree | 0fdd9ab26be7f280b7e05414d8e95cf16c241d10 /xlators/cluster/afr/src/afr-transaction.c | |
parent | 29619b4ee78926160435da82f9db213161e040d4 (diff) |
cluster/afr: Provide an option to disable afr durability
Change-Id: I40eec20ca6b3f857245a2438883822e251077ee9
BUG: 979365
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/5269
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-transaction.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-transaction.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index dbc74ceba..d307d5b3e 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -1495,8 +1495,10 @@ int afr_changelog_post_op_safe (call_frame_t *frame, xlator_t *this) { afr_local_t *local = NULL; + afr_private_t *priv = NULL; local = frame->local; + priv = this->private; if (!local->fd || local->transaction.type != AFR_DATA_TRANSACTION) { afr_changelog_post_op_now (frame, this); @@ -1548,9 +1550,15 @@ afr_changelog_post_op_safe (call_frame_t *frame, xlator_t *this) return 0; } - /* Time to fsync() */ - - afr_changelog_fsync (frame, this); + /* Check whether users want durability and perform fsync/post-op + * accordingly. + */ + if (priv->ensure_durability) { + /* Time to fsync() */ + afr_changelog_fsync (frame, this); + } else { + afr_changelog_post_op_now (frame, this); + } return 0; } |