summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-08-11 16:04:11 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-08-11 16:04:11 +0100
commit8dda67deb606486794792c7a87cfe18536dd817a (patch)
tree63b943fcbce705241e152bb740f801191b5bddf6
parent6fc0cf7c0007441e3bcebb49f193b15c7831c0aa (diff)
downloadrabbitmq-server-bug26335.tar.gz
Maybe a tad clearer?bug26335
-rw-r--r--src/rabbit_variable_queue.erl18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 42013ba0..871f909b 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -639,7 +639,7 @@ ack([SeqId], State) ->
State1 = #vqstate { index_state = IndexState,
msg_store_clients = MSCState,
ack_out_counter = AckOutCount }} =
- remove_pending_ack(SeqId, State),
+ remove_pending_ack(true, SeqId, State),
IndexState1 = case IndexOnDisk of
true -> rabbit_queue_index:ack([SeqId], IndexState);
false -> IndexState
@@ -658,7 +658,7 @@ ack(AckTags, State) ->
ack_out_counter = AckOutCount }} =
lists:foldl(
fun (SeqId, {Acc, State2}) ->
- {MsgStatus, State3} = remove_pending_ack(SeqId, State2),
+ {MsgStatus, State3} = remove_pending_ack(true, SeqId, State2),
{accumulate_ack(MsgStatus, Acc), State3}
end, {accumulate_ack_init(), State}, AckTags),
IndexState1 = rabbit_queue_index:ack(IndexOnDiskSeqIds, IndexState),
@@ -1278,14 +1278,14 @@ lookup_pending_ack(SeqId, #vqstate { ram_pending_ack = RPA,
none -> gb_trees:get(SeqId, DPA)
end.
-remove_pending_ack(SeqId, State) ->
+%% First parameter = UpdatePersistentCount
+remove_pending_ack(true, SeqId, State) ->
{MsgStatus, State1 = #vqstate { persistent_count = PCount }} =
- remove_pending_ack0(SeqId, State),
+ remove_pending_ack(false, SeqId, State),
PCount1 = PCount - one_if(MsgStatus#msg_status.is_persistent),
- {MsgStatus, State1 # vqstate{ persistent_count = PCount1 }}.
-
-remove_pending_ack0(SeqId, State = #vqstate { ram_pending_ack = RPA,
- disk_pending_ack = DPA }) ->
+ {MsgStatus, State1 # vqstate{ persistent_count = PCount1 }};
+remove_pending_ack(false, SeqId, State = #vqstate { ram_pending_ack = RPA,
+ disk_pending_ack = DPA }) ->
case gb_trees:lookup(SeqId, RPA) of
{value, V} -> RPA1 = gb_trees:delete(SeqId, RPA),
{V, State #vqstate { ram_pending_ack = RPA1 }};
@@ -1430,7 +1430,7 @@ delta_merge(SeqIds, Delta, MsgIds, State) ->
%% Mostly opposite of record_pending_ack/2
msg_from_pending_ack(SeqId, State) ->
{#msg_status { msg_props = MsgProps } = MsgStatus, State1} =
- remove_pending_ack0(SeqId, State),
+ remove_pending_ack(false, SeqId, State),
{MsgStatus #msg_status {
msg_props = MsgProps #message_properties { needs_confirming = false } },
State1}.