Skip to content

Commit 838cb93

Browse files
Merge pull request #10337 from rabbitmq/loic-revert-cqv2-default
Revert "Default to classic queues v2"
2 parents bc27870 + e57826f commit 838cb93

File tree

7 files changed

+35
-28
lines changed

7 files changed

+35
-28
lines changed

deps/rabbit/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ _APP_ENV = """[
8585
]},
8686
{halt_on_upgrade_failure, true},
8787
{ssl_apps, [asn1, crypto, public_key, ssl]},
88-
%% classic queue storage implementation version
89-
{classic_queue_default_version, 2},
9088
%% see rabbitmq-server#114
9189
{mirroring_flow_control, true},
9290
{mirroring_sync_batch_size, 4096},

deps/rabbit/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ define PROJECT_ENV
6565
]},
6666
{halt_on_upgrade_failure, true},
6767
{ssl_apps, [asn1, crypto, public_key, ssl]},
68-
%% classic queue storage implementation version
69-
{classic_queue_default_version, 2},
7068
%% see rabbitmq-server#114
7169
{mirroring_flow_control, true},
7270
{mirroring_sync_batch_size, 4096},

deps/rabbit/priv/schema/rabbit.schema

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,7 @@ end}.
24852485

24862486
{translation, "rabbit.classic_queue_default_version",
24872487
fun(Conf) ->
2488-
case cuttlefish:conf_get("classic_queue.default_version", Conf, 2) of
2488+
case cuttlefish:conf_get("classic_queue.default_version", Conf, 1) of
24892489
1 -> 1;
24902490
2 -> 2;
24912491
_ -> cuttlefish:unset()

deps/rabbit/src/rabbit_amqqueue_process.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,12 +470,12 @@ init_queue_mode(Mode, State = #q {backing_queue = BQ,
470470

471471
init_queue_version(Version0, State = #q {backing_queue = BQ,
472472
backing_queue_state = BQS}) ->
473-
%% When the version is undefined we use the default version 2.
473+
%% When the version is undefined we use the default version 1.
474474
%% We want to BQ:set_queue_version in all cases because a v2
475475
%% policy might have been deleted, for example, and we want
476476
%% the queue to go back to v1.
477477
Version = case Version0 of
478-
undefined -> rabbit_misc:get_env(rabbit, classic_queue_default_version, 2);
478+
undefined -> rabbit_misc:get_env(rabbit, classic_queue_default_version, 1);
479479
_ -> Version0
480480
end,
481481
BQS1 = BQ:set_queue_version(Version, BQS),

deps/rabbit/src/rabbit_variable_queue.erl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,10 @@ process_recovery_terms(Terms) ->
489489
PRef -> {PRef, Terms}
490490
end.
491491

492-
%% If queue-version is undefined, we assume v2 starting with RabbitMQ 3.13.0.
493492
queue_version(Q) ->
494493
Resolve = fun(_, ArgVal) -> ArgVal end,
495494
case rabbit_queue_type_util:args_policy_lookup(<<"queue-version">>, Resolve, Q) of
496-
undefined -> rabbit_misc:get_env(rabbit, classic_queue_default_version, 2);
495+
undefined -> rabbit_misc:get_env(rabbit, classic_queue_default_version, 1);
497496
Vsn when is_integer(Vsn) -> Vsn;
498497
Vsn -> binary_to_integer(Vsn)
499498
end.

deps/rabbitmq_management/test/rabbit_mgmt_http_SUITE.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,21 +1065,21 @@ queues_test(Config) ->
10651065
auto_delete => false,
10661066
exclusive => false,
10671067
arguments => #{},
1068-
storage_version => 2},
1068+
storage_version => 1},
10691069
#{name => <<"foo">>,
10701070
vhost => <<"/">>,
10711071
durable => true,
10721072
auto_delete => false,
10731073
exclusive => false,
10741074
arguments => #{},
1075-
storage_version => 2}], Queues),
1075+
storage_version => 1}], Queues),
10761076
assert_item(#{name => <<"foo">>,
10771077
vhost => <<"/">>,
10781078
durable => true,
10791079
auto_delete => false,
10801080
exclusive => false,
10811081
arguments => #{},
1082-
storage_version => 2}, Queue),
1082+
storage_version => 1}, Queue),
10831083

10841084
http_delete(Config, "/queues/%2F/foo", {group, '2xx'}),
10851085
http_delete(Config, "/queues/%2F/baz", {group, '2xx'}),
@@ -2274,8 +2274,8 @@ queue_pagination_test(Config) ->
22742274
?assertEqual(1, maps:get(page, PageOfTwo)),
22752275
?assertEqual(2, maps:get(page_size, PageOfTwo)),
22762276
?assertEqual(2, maps:get(page_count, PageOfTwo)),
2277-
assert_list([#{name => <<"test0">>, vhost => <<"/">>, storage_version => 2},
2278-
#{name => <<"test2_reg">>, vhost => <<"/">>, storage_version => 2}
2277+
assert_list([#{name => <<"test0">>, vhost => <<"/">>, storage_version => 1},
2278+
#{name => <<"test2_reg">>, vhost => <<"/">>, storage_version => 1}
22792279
], maps:get(items, PageOfTwo)),
22802280

22812281
SortedByName = http_get(Config, "/queues?sort=name&page=1&page_size=2", ?OK),

release-notes/3.13.0.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ Once all nodes are upgraded to 3.13.0, these irregularities will go away.
6464
Mixed version clusters are a mechanism that allows rolling upgrade and are not meant to be run for extended
6565
periods of time (no more than a few hours).
6666

67+
### Recommended Post-upgrade Procedures
68+
69+
#### Switch Classic Queues to CQv2
70+
71+
We recommend switching classic queues to CQv2 after **all cluster nodes** have been upgrades,
72+
at first using policies, and then eventually using a setting in `rabbitmq.conf`. Upgrading
73+
classic queues to CQv2 at boot time using the configuration file setting can be
74+
potentially unsafe in environments where deprecated classic mirrored queues still exist.
75+
76+
For new clusters, adopting CQv2 from the start is highly recommended:
77+
78+
``` ini
79+
classic_queue.default_version = 2
80+
```
6781

6882

6983
## Compatibility Notes
@@ -240,25 +254,23 @@ Release notes are kept under [rabbitmq-server/release-notes](https://github.com/
240254

241255
GitHub issue: [#8218](https://github.com/rabbitmq/rabbitmq-server/pull/8218)
242256

243-
* Reduced memory footprint, improved memory use predictability and throughput of classic queues (version 2, or CQv2).
244-
This particularly benefits classic queues with longer backlogs.
245-
246-
Classic queue v2 (CQv2) storage implementation **is now the default**. It is possible to switch
247-
the default back to CQv1 using `rabbitmq.conf`:
257+
* Revisited peer discovery implementation that further reduces the probability of two or more
258+
sets of nodes [forming separate clusters](https://www.rabbitmq.com/cluster-formation.html#initial-formation-race-condition) when **all** cluster nodes are created at the same time and boot in parallel.
248259

249-
``` ini
250-
# uses CQv1 by default
251-
classic_queue.default_version = 1
252-
```
260+
GitHub issue: [#9797](https://github.com/rabbitmq/rabbitmq-server/pull/9797)
253261

254-
Individual queues can be declared by passing `x-queue-version` argument and/or through a `queue-version` policy.
262+
* Classic queue storage v2 (CQv2) has matured and is now recommended for all users.
255263

256-
GitHub issue: [#8308](https://github.com/rabbitmq/rabbitmq-server/pull/8308)
264+
We recommend switching classic queues to CQv2 after **all cluster nodes** have been upgrades,
265+
at first using policies, and then eventually using a setting in `rabbitmq.conf`. Upgrading
266+
classic queues to CQv2 at boot time using the configuration file setting can be
267+
potentially unsafe in environments where deprecated classic mirrored queues still exist.
257268

258-
* Revisited peer discovery implementation that further reduces the probability of two or more
259-
sets of nodes [forming separate clusters](https://www.rabbitmq.com/cluster-formation.html#initial-formation-race-condition) when **all** cluster nodes are created at the same time and boot in parallel.
269+
For new clusters, adopt CQv2 from the start by setting `classic_queue.default_version` in `rabbitmq.conf`:
260270

261-
GitHub issue: [#9797](https://github.com/rabbitmq/rabbitmq-server/pull/9797)
271+
``` ini
272+
classic_queue.default_version = 2
273+
```
262274

263275
* Non-mirrored classic queues: optimizations of storage for larger (greater than 4 kiB) messages.
264276

0 commit comments

Comments
 (0)