diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2010-12-12 23:53:06 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-12-12 23:53:06 +0000 |
| commit | 15b8801f46667733c8fd6fcc0cf73cbe62ab1ad7 (patch) | |
| tree | afdf730080f804412cbbec0c97a1a21cbf82a920 /src | |
| parent | 4e976be099370a99e90cc85bea9491ca0afd769a (diff) | |
| download | rabbitmq-server-git-15b8801f46667733c8fd6fcc0cf73cbe62ab1ad7.tar.gz | |
Alter the result of BQ:requeue so that it also returns the guids of the requeued messages. This makes it match the spec of ack closely and is more logical. Also, entirely coincidentally, happens to be necessary for HA...
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue_process.erl | 4 | ||||
| -rw-r--r-- | src/rabbit_tests.erl | 3 | ||||
| -rw-r--r-- | src/rabbit_variable_queue.erl | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index c1972c261b..1c4a371675 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -544,7 +544,9 @@ deliver_or_enqueue(Delivery, State) -> requeue_and_run(AckTags, State = #q{backing_queue = BQ, ttl=TTL}) -> maybe_run_queue_via_backing_queue( fun (BQS) -> - BQ:requeue(AckTags, reset_msg_expiry_fun(TTL), BQS) + {_Guids, BQS1} = + BQ:requeue(AckTags, reset_msg_expiry_fun(TTL), BQS), + BQS1 end, State). fetch(AckRequired, State = #q{backing_queue_state = BQS, diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl index 3343bb99cd..7f6c5d3d36 100644 --- a/src/rabbit_tests.erl +++ b/src/rabbit_tests.erl @@ -2047,7 +2047,8 @@ test_variable_queue_all_the_bits_not_covered_elsewhere2(VQ0) -> VQ1 = rabbit_variable_queue:set_ram_duration_target(0, VQ0), VQ2 = variable_queue_publish(false, 4, VQ1), {VQ3, AckTags} = variable_queue_fetch(2, false, false, 4, VQ2), - VQ4 = rabbit_variable_queue:requeue(AckTags, fun(X) -> X end, VQ3), + {_Guids, VQ4} = + rabbit_variable_queue:requeue(AckTags, fun(X) -> X end, VQ3), VQ5 = rabbit_variable_queue:idle_timeout(VQ4), _VQ6 = rabbit_variable_queue:terminate(VQ5), VQ7 = rabbit_variable_queue:init(test_amqqueue(true), true, diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index d1da2c8917..acbbe458f3 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -716,7 +716,7 @@ tx_commit(Txn, Fun, MsgPropsFun, end)}. requeue(AckTags, MsgPropsFun, State) -> - {_Guids, State1} = + {Guids, State1} = ack(fun msg_store_release/3, fun (#msg_status { msg = Msg, msg_props = MsgProps }, State1) -> {_SeqId, State2} = publish(Msg, MsgPropsFun(MsgProps), @@ -732,7 +732,7 @@ requeue(AckTags, MsgPropsFun, State) -> State3 end, AckTags, State), - a(reduce_memory_use(State1)). + {Guids, a(reduce_memory_use(State1))}. len(#vqstate { len = Len }) -> Len. |
