Skip to content

Commit 0341b5f

Browse files
authored
Merge pull request #9508 from rabbitmq/mergify/bp/v3.12.x/pr-9507
CQ: Fix a crash when CMQ master changes in mixed environment test (backport #9507)
2 parents 64116a9 + 6bcbcbd commit 0341b5f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

deps/rabbit/src/rabbit_variable_queue.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,11 @@ convert_from_v2_to_v1_loop(QueueName, V1Index0, V2Index0, V2Store0,
11771177
V1Index1b = rabbit_queue_index:publish(MsgId, SeqId, rabbit_msg_store, Props, IsPersistent, infinity, V1Index1a),
11781178
rabbit_queue_index:deliver([SeqId], V1Index1b)
11791179
end,
1180-
{V1Index2, V2Store1}
1180+
{V1Index2, V2Store1};
1181+
%% Ignore messages that are in memory and had an entry written in the index.
1182+
%% @todo Remove this clause some time after CMQs get removed as this will become dead code.
1183+
({undefined, _, memory, _, _}, {V1Index1, V2Store1}) ->
1184+
{V1Index1, V2Store1}
11811185
end, {V1Index0, V2Store0}, Messages),
11821186
%% Flush to disk to avoid keeping too much in memory between segments.
11831187
V1Index = rabbit_queue_index:flush(V1Index3),

0 commit comments

Comments
 (0)