summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue.erl8
-rw-r--r--src/rabbit_nodes.erl14
2 files changed, 13 insertions, 9 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index 25e5a56d42..21c027451d 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -1105,10 +1105,10 @@ list_local_mirrored_classic_without_synchronised_mirrors_for_cli() ->
[begin
#resource{name = Name} = amqqueue:get_name(Q),
#{
- <<"readable_name">> => rabbit_misc:rs(amqqueue:get_name(Q)),
- <<"name">> => Name,
- <<"virtual_host">> => amqqueue:get_vhost(Q),
- <<"type">> => <<"quorum">>
+ <<"readable_name">> => rabbit_data_coercion:to_binary(rabbit_misc:rs(amqqueue:get_name(Q))),
+ <<"name">> => Name,
+ <<"virtual_host">> => amqqueue:get_vhost(Q),
+ <<"type">> => <<"classic">>
}
end || Q <- ClassicQs].
diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl
index 1f066c6b91..d209798575 100644
--- a/src/rabbit_nodes.erl
+++ b/src/rabbit_nodes.erl
@@ -20,8 +20,8 @@
-export([names/1, diagnostics/1, make/1, make/2, parts/1, cookie_hash/0,
is_running/2, is_process_running/2,
cluster_name/0, set_cluster_name/1, set_cluster_name/2, ensure_epmd/0,
- all_running/0, name_type/0, running_count/0,
- await_running_count/2,
+ all_running/0, name_type/0, running_count/0, total_count/0,
+ await_running_count/2, is_single_node_cluster/0,
boot/0]).
-export([persistent_cluster_id/0, seed_internal_cluster_id/0, seed_user_provided_cluster_name/0]).
@@ -138,15 +138,19 @@ ensure_epmd() ->
rabbit_nodes_common:ensure_epmd().
-spec all_running() -> [node()].
-
all_running() -> rabbit_mnesia:cluster_nodes(running).
-spec running_count() -> integer().
-
running_count() -> length(all_running()).
--spec await_running_count(integer(), integer()) -> 'ok' | {'error', atom()}.
+-spec total_count() -> integer().
+total_count() -> length(rabbit_mnesia:cluster_nodes(all)).
+-spec is_single_node_cluster() -> boolean().
+is_single_node_cluster() ->
+ total_count() =:= 1.
+
+-spec await_running_count(integer(), integer()) -> 'ok' | {'error', atom()}.
await_running_count(TargetCount, Timeout) ->
Retries = round(Timeout/?SAMPLING_INTERVAL),
await_running_count_with_retries(TargetCount, Retries).