diff options
-rw-r--r-- | tests/bugs/bug-888174.t | 4 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 11 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-transaction.c | 22 |
3 files changed, 21 insertions, 16 deletions
diff --git a/tests/bugs/bug-888174.t b/tests/bugs/bug-888174.t index 76ca3c961f4..4ea34645bd6 100644 --- a/tests/bugs/bug-888174.t +++ b/tests/bugs/bug-888174.t @@ -43,7 +43,7 @@ EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_0/a trusted.a EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_1/a trusted.afr.$V0-client-0 EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_1/a trusted.afr.$V0-client-1 -dd of=$M0/a if=/dev/urandom bs=1M count=1024 oflag=sync 2>/dev/null & +dd of=$M0/a if=/dev/urandom bs=1M count=1024 2>/dev/null & p=$! #trigger graph switches, tests for fsync not leaving any pending flags TEST $CLI volume set $V0 performance.quick-read off @@ -55,6 +55,8 @@ kill -SIGTERM $p #wait for dd to exit wait > /dev/null 2>&1 +#Goal is to check if there is permanent FOOL changelog +sleep 5 EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_0/a trusted.afr.$V0-client-0 EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_0/a trusted.afr.$V0-client-1 EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_1/a trusted.afr.$V0-client-0 diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index c55adc1ee9c..0eca21309a8 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -852,11 +852,6 @@ afr_local_transaction_cleanup (afr_local_t *local, xlator_t *this) loc_wipe (&local->transaction.new_parent_loc); GF_FREE (local->transaction.postop_piggybacked); - - if (local->transaction.resume_stub) { - call_resume (local->transaction.resume_stub); - local->transaction.resume_stub = NULL; - } } @@ -2692,8 +2687,10 @@ afr_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, post-op. This guarantee is expected by FUSE graph switching for example. */ - stub = fop_fsync_cbk_stub (frame, default_fsync_cbk, op_ret, - op_errno, prebuf, postbuf, xdata); + stub = fop_fsync_cbk_stub (frame, default_fsync_cbk, + local->op_ret, local->op_errno, + &local->cont.fsync.prebuf, + &local->cont.fsync.postbuf, xdata); if (!stub) { AFR_STACK_UNWIND (fsync, frame, -1, ENOMEM, 0, 0, 0); return 0; diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index f632a2b701a..e54f9c2cbec 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -398,6 +398,11 @@ afr_changelog_post_op_cbk (call_frame_t *frame, void *cookie, xlator_t *this, UNLOCK (&frame->lock); if (call_count == 0) { + if (local->transaction.resume_stub) { + call_resume (local->transaction.resume_stub); + local->transaction.resume_stub = NULL; + } + if (afr_lock_server_count (priv, local->transaction.type) == 0) { local->transaction.done (frame, this); } else { @@ -1370,12 +1375,6 @@ is_piggyback_post_op (call_frame_t *frame, fd_t *fd) local = frame->local; fdctx = afr_fd_ctx_get (fd, frame->this); - if (!afr_txn_nothing_failed (frame, frame->this)) - /* something failed in this transaction, - we will be performing a hard post-op - */ - return _gf_false; - LOCK(&fd->lock); { piggyback = _gf_true; @@ -1398,7 +1397,14 @@ is_piggyback_post_op (call_frame_t *frame, fd_t *fd) } UNLOCK(&fd->lock); - return piggyback; + if (!afr_txn_nothing_failed (frame, frame->this)) { + /* something failed in this transaction, + we will be performing a hard post-op + */ + return _gf_false; + } + + return piggyback; } @@ -1619,7 +1625,7 @@ unlock: local = prev_frame->local; local->transaction.resume_stub = stub; afr_changelog_post_op_safe (prev_frame, this); - } else { + } else if (stub) { call_resume (stub); } } |