Skip to content

Commit

Permalink
Merge pull request rabbitmq#11373 from rabbitmq/qq-server-recovery
Browse files Browse the repository at this point in the history
QQ: Enable server recovery.
  • Loading branch information
michaelklishin authored Jun 4, 2024
2 parents 55b38bd + 08a8f93 commit 44c3819
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deps/rabbit/src/rabbit_ra_systems.erl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ get_config(quorum_queues = RaSystem) ->
wal_compute_checksums => WalChecksums,
wal_max_entries => WalMaxEntries,
segment_compute_checksums => SegmentChecksums,
compress_mem_tables => CompressMemTables};
compress_mem_tables => CompressMemTables,
server_recovery_strategy => registered};
get_config(coordination = RaSystem) ->
DefaultConfig = get_default_config(),
CoordDataDir = filename:join(
Expand Down
23 changes: 23 additions & 0 deletions deps/rabbit/test/quorum_queue_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ all_tests() ->
sync_queue,
cancel_sync_queue,
idempotent_recover,
server_system_recover,
vhost_with_quorum_queue_is_deleted,
vhost_with_default_queue_type_declares_quorum_queue,
delete_immediately_by_resource,
Expand Down Expand Up @@ -720,6 +721,28 @@ idempotent_recover(Config) ->
end, ?DEFAULT_AWAIT),
ok.

server_system_recover(Config) ->
Server = rabbit_ct_broker_helpers:get_node_config(Config, 0, nodename),

Ch = rabbit_ct_client_helpers:open_channel(Config, Server),
LQ = ?config(queue_name, Config),
?assertEqual({'queue.declare_ok', LQ, 0, 0},
declare(Ch, LQ, [{<<"x-queue-type">>, longstr, <<"quorum">>}])),

RaName = ra_name(LQ),
_ = ra:members({RaName, Server}),
EtsPid = ct_rpc:call(Server, erlang, whereis, [ra_log_ets]),
?assert(is_pid(EtsPid)),

true = ct_rpc:call(Server, erlang, exit, [EtsPid, kill]),

%% validate quorum queue is still functional
?awaitMatch({ok, _, _},
begin
ra:members({RaName, Server})
end, ?DEFAULT_AWAIT),
ok.

vhost_with_quorum_queue_is_deleted(Config) ->
Node = rabbit_ct_broker_helpers:get_node_config(Config, 0, nodename),
VHost = <<"vhost2">>,
Expand Down

0 comments on commit 44c3819

Please sign in to comment.