diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-10-26 17:39:55 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-10-26 17:39:55 +0000 |
| commit | e489eaf0fc027407fb4b176fd29ac8f28ec727e0 (patch) | |
| tree | cafdf3eec394181aced9f50853e179c56042260f /src | |
| parent | ba4d3e0e1aadcfe367b55717bce2f3ec370f44cc (diff) | |
| download | rabbitmq-server-git-e489eaf0fc027407fb4b176fd29ac8f28ec727e0.tar.gz | |
Added check in the qi startup that msgs must be in the msg_store. This affected some of the tests. All seems to work.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_queue_index.erl | 17 | ||||
| -rw-r--r-- | src/rabbit_tests.erl | 1 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/rabbit_queue_index.erl b/src/rabbit_queue_index.erl index 0870acc596..db738857ee 100644 --- a/src/rabbit_queue_index.erl +++ b/src/rabbit_queue_index.erl @@ -464,8 +464,10 @@ queue_index_walker({[], State, SegNums, QueueNames}) -> queue_index_walker({SegNums, State, QueueNames}); queue_index_walker({[{_RelSeq, {MsgId, _IsDelivered, IsPersistent}} | Msgs], State, SegNums, QueueNames}) -> - {MsgId, bool_to_int(IsPersistent), - {Msgs, State, SegNums, QueueNames}}. + case IsPersistent of + true -> {MsgId, 1, {Msgs, State, SegNums, QueueNames}}; + false -> queue_index_walker({Msgs, State, SegNums, QueueNames}) + end. %%---------------------------------------------------------------------------- @@ -544,8 +546,15 @@ replay_journal_acks_to_segment(SegNum, Acks, {TotalMsgCount, State}) -> deliver_transient(SegNum, SDict, State) -> {AckMe, DeliverMe} = dict:fold( - fun (_RelSeq, {_MsgId, _IsDelivered, true}, Acc) -> - Acc; + fun (RelSeq, {MsgId, IsDelivered, true}, {AckMeAcc, DeliverMeAcc}) -> + case {IsDelivered, rabbit_msg_store:contains(MsgId)} of + {_, true} -> + {AckMeAcc, DeliverMeAcc}; + {true, false} -> + {[RelSeq | AckMeAcc], DeliverMeAcc}; + {false, false} -> + {[RelSeq | AckMeAcc], [RelSeq | DeliverMeAcc]} + end; (RelSeq, {_MsgId, false, false}, {AckMeAcc, DeliverMeAcc}) -> {[RelSeq | AckMeAcc], [RelSeq | DeliverMeAcc]}; (RelSeq, {_MsgId, true, false}, {AckMeAcc, DeliverMeAcc}) -> diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl index ebd8432a20..7bf480d728 100644 --- a/src/rabbit_tests.erl +++ b/src/rabbit_tests.erl @@ -1008,6 +1008,7 @@ queue_index_publish(SeqIds, Persistent, Qi) -> MsgId = rabbit_guid:guid(), QiM = rabbit_queue_index:write_published(MsgId, SeqId, Persistent, QiN), + ok = rabbit_msg_store:write(MsgId, MsgId), {QiM, [{SeqId, MsgId} | SeqIdsMsgIdsAcc]} end, {Qi, []}, SeqIds). |
