summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2012-01-20 12:56:18 +0000
committerEmile Joubert <emile@rabbitmq.com>2012-01-20 12:56:18 +0000
commita6e9bfa54f3606eecfddad9eb3c2579bc3193270 (patch)
treefce3257806638112b833ccfdb86b6cb5cd25e547
parentd13c96bdc9499c9af8be7a7fb8d87639645933db (diff)
downloadrabbitmq-server-git-a6e9bfa54f3606eecfddad9eb3c2579bc3193270.tar.gz
Don't fsync after inner nested transactions
-rw-r--r--src/rabbit_misc.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index a508794c4c..a5fef7c3ae 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -419,7 +419,10 @@ execute_mnesia_transaction(TxFun) ->
%% elsewhere and get a consistent result even when that read
%% executes on a different node.
case worker_pool:submit({mnesia, sync_transaction, [TxFun]}) of
- {atomic, Result} -> mnesia_sync:sync(),
+ {atomic, Result} -> case mnesia:is_transaction() of
+ true -> ok;
+ false -> mnesia_sync:sync()
+ end,
Result;
{aborted, Reason} -> throw({error, Reason})
end.