Skip to content

Commit 432997a

Browse files
committed
Bugfixes
1 parent 587b496 commit 432997a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

deps/rabbit/src/rabbit_msg_store.erl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,8 +1152,11 @@ write_message(MsgId, Msg, CRef,
11521152
end, CRef, State1)
11531153
end.
11541154

1155-
remove_message(MsgId, CRef, State = #msstate{
1156-
index_ets = IndexEts, current_file = CurrentFile }) ->
1155+
remove_message(MsgId, CRef,
1156+
State = #msstate{
1157+
index_ets = IndexEts,
1158+
current_file = CurrentFile,
1159+
current_file_removes = Removes }) ->
11571160
case should_mask_action(CRef, MsgId, State) of
11581161
{true, _Location} ->
11591162
State;
@@ -1340,15 +1343,16 @@ write_large_message(MsgId, MsgBodyBin,
13401343
current_file = NextFile,
13411344
current_file_offset = 0 }.
13421345

1343-
cleanup_index_on_roll_over(State = #msstate{ index_ets = IndexEts,
1344-
current_file = CurrentFile, current_file_removes = Removes}) ->
1346+
cleanup_index_on_roll_over(State = #msstate{
1347+
index_ets = IndexEts,
1348+
current_file_removes = Removes}) ->
13451349
lists:foreach(fun(Entry) ->
13461350
%% We delete objects that have ref_count=0. If a message
13471351
%% got its ref_count increased, it will not be deleted.
13481352
%% We thus avoid extra index lookups to check for ref_count.
13491353
index_delete_object(IndexEts, Entry)
13501354
end, Removes),
1351-
State=#msstate{current_file_removes=[]}.
1355+
State#msstate{current_file_removes=[]}.
13521356

13531357
contains_message(MsgId, From, State = #msstate{ index_ets = IndexEts }) ->
13541358
MsgLocation = index_lookup_positive_ref_count(IndexEts, MsgId),
@@ -2150,9 +2154,9 @@ truncate_file(File, Size, ThresholdTimestamp, #gc_state{ file_summary_ets = File
21502154

21512155
-spec delete_file(non_neg_integer(), gc_state()) -> ok | defer.
21522156

2153-
delete_file(File, State = #gc_state { file_summary_ets = FileSummaryEts,
2154-
file_handles_ets = FileHandlesEts,
2155-
dir = Dir }) ->
2157+
delete_file(File, #gc_state { file_summary_ets = FileSummaryEts,
2158+
file_handles_ets = FileHandlesEts,
2159+
dir = Dir }) ->
21562160
case ets:match_object(FileHandlesEts, {{'_', File}, '_'}, 1) of
21572161
{[_|_], _Cont} ->
21582162
rabbit_log:debug("Asked to delete file ~p but it has active readers. Deferring.",

0 commit comments

Comments
 (0)