summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-10-02 11:35:11 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2012-10-02 11:35:11 +0100
commit72e5fb833f2f0c16d4e13e6dd00641a7a44bb32a (patch)
treefb32dcf9790ab90f35e7a1e8aea7a40e691389c9
parentd0ccf58dec4511707ad10e6a7b8970c34c2e52ad (diff)
downloadrabbitmq-server-72e5fb833f2f0c16d4e13e6dd00641a7a44bb32a.tar.gz
remove gratuitous ack numbering
the sole purpose of which was to sort the acktags by that number, which serves no purpose whatsoever.
-rw-r--r--src/rabbit_mirror_queue_slave.erl15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index 1832049d..2a58e897 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -72,7 +72,6 @@
sender_queues, %% :: Pid -> {Q Msg, Set MsgId}
msg_id_ack, %% :: MsgId -> AckTag
- ack_num,
msg_id_status,
known_senders,
@@ -125,7 +124,6 @@ init(#amqqueue { name = QueueName } = Q) ->
sender_queues = dict:new(),
msg_id_ack = dict:new(),
- ack_num = 0,
msg_id_status = dict:new(),
known_senders = pmon:new(),
@@ -520,7 +518,7 @@ promote_me(From, #state { q = Q = #amqqueue { name = QName },
[{MsgId, Status}
|| {MsgId, {Status, _ChPid}} <- MSList,
Status =:= published orelse Status =:= confirmed]),
- AckTags = [AckTag || {_MsgId, {_Num, AckTag}} <- dict:to_list(MA)],
+ AckTags = [AckTag || {_MsgId, AckTag} <- dict:to_list(MA)],
MasterState = rabbit_mirror_queue_master:promote_backing_queue_state(
CPid, BQ, BQS, GM, AckTags, SS, MPids),
@@ -862,19 +860,16 @@ msg_ids_to_acktags(MsgIds, MA) ->
lists:foldl(
fun (MsgId, {Acc, MAN}) ->
case dict:find(MsgId, MA) of
- error -> {Acc, MAN};
- {ok, {_Num, AckTag}} -> {[AckTag | Acc],
- dict:erase(MsgId, MAN)}
+ error -> {Acc, MAN};
+ {ok, AckTag} -> {[AckTag | Acc], dict:erase(MsgId, MAN)}
end
end, {[], MA}, MsgIds),
{lists:reverse(AckTags), MA1}.
maybe_store_ack(false, _MsgId, _AckTag, State) ->
State;
-maybe_store_ack(true, MsgId, AckTag, State = #state { msg_id_ack = MA,
- ack_num = Num }) ->
- State #state { msg_id_ack = dict:store(MsgId, {Num, AckTag}, MA),
- ack_num = Num + 1 }.
+maybe_store_ack(true, MsgId, AckTag, State = #state { msg_id_ack = MA }) ->
+ State #state { msg_id_ack = dict:store(MsgId, AckTag, MA) }.
set_delta(0, State = #state { depth_delta = undefined }) ->
ok = record_synchronised(State#state.q),