diff options
| author | Michael Klishin <klishinm@vmware.com> | 2022-07-20 21:36:01 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-20 21:36:01 +0400 |
| commit | 9c91efa9f3a5e3bf1b3bb2d827639940e1f9e9d7 (patch) | |
| tree | ce58085fc63a71aa29f0870a53cf999cc3c19a88 | |
| parent | 18cd2c5f9ea05af0109f9ee6ffcebc8da25c8dc7 (diff) | |
| parent | e834f39b6b00831b1a2f1cf5f8dbd7c4f1f76897 (diff) | |
| download | rabbitmq-server-git-9c91efa9f3a5e3bf1b3bb2d827639940e1f9e9d7.tar.gz | |
Merge pull request #5281 from rabbitmq/loic-fix-cqv2-badmatch-5252
CQ: Fix two accidental state overwrites
| -rw-r--r-- | deps/rabbit/src/rabbit_classic_queue_index_v2.erl | 2 | ||||
| -rw-r--r-- | deps/rabbit/src/rabbit_variable_queue.erl | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/deps/rabbit/src/rabbit_classic_queue_index_v2.erl b/deps/rabbit/src/rabbit_classic_queue_index_v2.erl index 75d431f914..d5c8bc0dae 100644 --- a/deps/rabbit/src/rabbit_classic_queue_index_v2.erl +++ b/deps/rabbit/src/rabbit_classic_queue_index_v2.erl @@ -982,7 +982,7 @@ read_from_disk(SeqIdsToRead0, State0 = #qi{ write_buffer = WriteBuffer }, Acc0) %% We reached the end of a partial file. %% Everything past that point is non-existent. %% This probably does not happen outside of tests. - read_from_disk(SeqIdsToRead, State0, Acc0) + read_from_disk(SeqIdsToRead, State, Acc0) end; %% The segment file no longer exists. This is equivalent to a file %% where all entries are non-existent/acked. This can happen after diff --git a/deps/rabbit/src/rabbit_variable_queue.erl b/deps/rabbit/src/rabbit_variable_queue.erl index d988fc0ec3..9f8c2336b0 100644 --- a/deps/rabbit/src/rabbit_variable_queue.erl +++ b/deps/rabbit/src/rabbit_variable_queue.erl @@ -2094,9 +2094,7 @@ remove_by_predicate(Pred, State = #vqstate {out_counter = OutCount}) -> %% %% @todo See todo in remove_by_predicate/2 function. fetch_by_predicate(Pred, Fun, FetchAcc, - State = #vqstate { - index_state = IndexState1, - out_counter = OutCount}) -> + State = #vqstate { out_counter = OutCount}) -> {MsgProps, QAcc, State1} = collect_by_predicate(Pred, ?QUEUE:new(), State), @@ -2106,7 +2104,6 @@ fetch_by_predicate(Pred, Fun, FetchAcc, {MsgProps, FetchAcc1, maybe_update_rates( State2 #vqstate { next_deliver_seq_id = NextDeliverSeqId, - index_state = IndexState1, out_counter = OutCount + ?QUEUE:len(QAcc)})}. %% We try to do here the same as what remove(true, State) does but |
