diff options
| author | Matthias Radestock <matthias@lshift.net> | 2010-05-19 13:33:04 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2010-05-19 13:33:04 +0100 |
| commit | d5816a10609d2a20de494b10e58cc03c8e276685 (patch) | |
| tree | 3d8e2ba05463ed0ed13bae9c0bc700e7c0b45316 /src | |
| parent | b366bc7f483cc54e53a7bf19a580d0b9c0868db3 (diff) | |
| download | rabbitmq-server-git-d5816a10609d2a20de494b10e58cc03c8e276685.tar.gz | |
cosmetic
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_queue_index.erl | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/rabbit_queue_index.erl b/src/rabbit_queue_index.erl index 67bf9f5236..32ada56931 100644 --- a/src/rabbit_queue_index.erl +++ b/src/rabbit_queue_index.erl @@ -241,8 +241,8 @@ init(Name, MsgStoreRecovered, ContainsCheckFun) -> end, {Segments, 0}, all_segment_nums(State1)); true -> %% At this stage, we will only know about files that - %% were loaded during journal loading, They *will* have - %% correct ack and pub counts, but for all remaining + %% were loaded during journal loading, They *will* + %% have correct unacked counts, but for all remaining %% segments, if they're not in the Segments store then %% we need to add them and populate with saved data. SegmentDictTerms = @@ -642,15 +642,12 @@ load_journal(State) -> %% counts here are purely from the segment itself. {SegEntries, UnackedCountInSeg, Segment1} = load_segment(true, Segment), - %% Removed counts here are the number of pubs and - %% acks that are duplicates - i.e. found in both the - %% segment and journal. {JEntries1, UnackedCountDuplicates} = journal_minus_segment(JEntries, SegEntries), Segment1 #segment { journal_entries = JEntries1, - unacked = UnackedCountInJournal + - UnackedCountInSeg - - UnackedCountDuplicates } + unacked = (UnackedCountInJournal + + UnackedCountInSeg - + UnackedCountDuplicates) } end, Segments), State2 #qistate { segments = Segments1 }. @@ -724,12 +721,11 @@ get_segment_handle(Segment = #segment { handle = Hdl }) -> {Hdl, Segment}. segment_new(Seg, Dir) -> - #segment { unacked = 0, - handle = undefined, + #segment { unacked = 0, + handle = undefined, journal_entries = array_new(), - path = seg_num_to_path(Dir, Seg), - num = Seg - }. + path = seg_num_to_path(Dir, Seg), + num = Seg }. segment_find_or_new(Seg, Dir, Segments) -> case segment_find(Seg, Segments) of |
