diff options
| author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-10-04 11:54:16 +0100 |
|---|---|---|
| committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-10-04 11:54:16 +0100 |
| commit | 290ac1e2bba29a156ad7bfcbd5c781f0c822b122 (patch) | |
| tree | e31d56c27a2a597e8920efdf0b6d833a05093bbe | |
| parent | 1ae974f61e61e558783e5fdd7383f2b8759596c2 (diff) | |
| download | rabbitmq-server-git-290ac1e2bba29a156ad7bfcbd5c781f0c822b122.tar.gz | |
confirm messages when they get written do disk in *any* queue; confirm messages immediately if they've already been written to disk
| -rw-r--r-- | src/rabbit_msg_store.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 1a25e7900c..0dba4dd27d 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -683,13 +683,18 @@ handle_cast({write, CRef, Guid}, sum_valid_data = SumValid + TotalSize, sum_file_size = SumFileSize + TotalSize, cref_to_guids = CTG1 })); - #msg_location { ref_count = RefCount } -> + #msg_location { ref_count = RefCount, file = File } -> %% We already know about it, just update counter. Only %% update field otherwise bad interaction with concurrent GC ok = index_update_fields(Guid, {#msg_location.ref_count, RefCount + 1}, State), - noreply(State) + CTG1 = case {dict:find(CRef, CODC), File =:= CurFile} of + {{ok, _} , true} -> rabbit_misc:dict_cons(CRef, Guid, CTG); + {{ok, Fun}, false} -> Fun([Guid]), CTG; + _ -> CTG + end, + noreply(State #msstate { cref_to_guids = CTG1 }) end; handle_cast({remove, Guids}, State) -> |
