diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2013-06-17 18:04:25 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2013-06-17 18:04:25 +0100 |
commit | f238e42877299a9d61694b88dbebf85c20709750 (patch) | |
tree | f9bd3485a80a197d4f32ae39024f08df54851505 | |
parent | 6a554f8e109b57d7d2f751edb7eacb517f336817 (diff) | |
parent | b106047a4df6a5d230097a4ada549be69fade0c7 (diff) | |
download | rabbitmq-server-f238e42877299a9d61694b88dbebf85c20709750.tar.gz |
merge stable into default
-rw-r--r-- | src/rabbit_msg_store.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 7c2aa13c..b783aa18 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -978,7 +978,7 @@ update_flying(Diff, MsgId, CRef, #msstate { flying_ets = FlyingEts }) -> NDiff = -Diff, case ets:lookup(FlyingEts, Key) of [] -> ignore; - [{_, Diff}] -> ignore; + [{_, Diff}] -> ignore; %% [1] [{_, NDiff}] -> ets:update_counter(FlyingEts, Key, {2, Diff}), true = ets:delete_object(FlyingEts, {Key, 0}), process; @@ -986,6 +986,13 @@ update_flying(Diff, MsgId, CRef, #msstate { flying_ets = FlyingEts }) -> ignore; [{_, Err}] -> throw({bad_flying_ets_record, Diff, Err, Key}) end. +%% [1] We can get here, for example, in the following scenario: There +%% is a write followed by a remove in flight. The counter will be 0, +%% so on processing the write the server attempts to delete the +%% entry. If at that point the client injects another write it will +%% either insert a new entry, containing +1, or increment the existing +%% entry to +1, thus preventing its removal. Either way therefore when +%% the server processes the read, the counter will be +1. write_action({true, not_found}, _MsgId, State) -> {ignore, undefined, State}; |