Merge pull request #11373 from rabbitmq/qq-server-recovery

QQ: Enable server recovery.
This commit is contained in:
Michael Klishin 2024-06-04 15:50:16 -04:00 committed by GitHub
commit 44c381929e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 1 deletions

View File

@ -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(

View File

@ -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,
@ -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">>,