Skip to content

Commit

Permalink
CLI: s/metadata_store/rabbitmq_metadata/
Browse files Browse the repository at this point in the history
Fixes error handling and a `clsutering_management_SUITE` transient
failure.
  • Loading branch information
dumbbell committed Sep 29, 2023
1 parent 6deac1d commit 05f3bb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion deps/rabbit/test/clustering_management_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,16 @@ forget_unavailable_node_in_minority(Config) ->
30000),

%% If Hare was the leader, it is able to forget one of the nodes. Change takes place as soon as it is written on the log. The other membership change will be rejected until the last change has consensus.
ct:pal("Initial Raft status: ~p", [RaftStatus]),
case RaftStatus of
leader ->
?assertMatch(ok, forget_cluster_node(Config, Hare, Rabbit)),
not_permitted(forget_cluster_node(Config, Hare, Bunny));
follower ->
%% Follower might have been promoted before the second node goes down, check the status again
case get_raft_status(Config, Hare) of
RaftStatus1 = get_raft_status(Config, Hare),
ct:pal("Latest Raft status: ~p", [RaftStatus1]),
case RaftStatus1 of
leader ->
?assertMatch(ok, forget_cluster_node(Config, Hare, Rabbit)),
not_permitted(forget_cluster_node(Config, Hare, Bunny));
Expand Down
2 changes: 1 addition & 1 deletion deps/rabbitmq_cli/lib/rabbitmq/cli/default_output.ex
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defmodule RabbitMQ.CLI.DefaultOutput do
defp normalize_output({unknown, _} = input, _opts) when is_atom(unknown), do: {:error, input}
defp normalize_output(result, _opts) when not is_atom(result), do: {:ok, result}

defp format_khepri_output({:error, {:timeout, {:metadata_store, _}}}, %{node: node_name}) do
defp format_khepri_output({:error, {:timeout, {:rabbitmq_metadata, _}}}, %{node: node_name}) do
{:error, RabbitMQ.CLI.Core.ExitCodes.exit_tempfail(), khepri_timeout_error(node_name)}
end

Expand Down

0 comments on commit 05f3bb0

Please sign in to comment.