diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-04-10 23:21:54 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-04-10 23:21:54 +0100 |
| commit | 1882d139375274368a3ab2bffe3695c2d3f5c9bc (patch) | |
| tree | 7049339ef125498a3e025507dd30b9e8829bd16d /src | |
| parent | a5e21a259e46557fc6d405fe38ce4685726d72e4 (diff) | |
| download | rabbitmq-server-git-1882d139375274368a3ab2bffe3695c2d3f5c9bc.tar.gz | |
did some profiling and brought out an mnesia lock much earlier.
This means that for large commits, the resulting mnesia transaction is _much_ faster.
also fixed makefile so that cleandb wipes out disk_queue too
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_disk_queue.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rabbit_disk_queue.erl b/src/rabbit_disk_queue.erl index e7100061fc..391c9b715c 100644 --- a/src/rabbit_disk_queue.erl +++ b/src/rabbit_disk_queue.erl @@ -269,7 +269,8 @@ internal_tx_commit(Q, MsgIds, State = #dqstate { msg_location = MsgLocation, }) -> {atomic, Sync} = mnesia:transaction( - fun() -> lists:foldl(fun (MsgId, Acc) -> + fun() -> ok = mnesia:write_lock_table(rabbit_disk_queue), + lists:foldl(fun (MsgId, Acc) -> [{MsgId, _RefCount, File, _Offset, _TotalSize}] = ets:lookup(MsgLocation, MsgId), ok = mnesia:write(rabbit_disk_queue, #dq_msg_loc { queue_and_msg_id = {MsgId, Q}, is_delivered = false}, write), |
